recovery from being cheated on

Just found out my boyfriend has been cheating on me with his ex. I've never experienced this pain, it physically hurts. I'm so confused and shocked, I had no idea at all until this girl messaged me. I felt bad for even believing his "crazy ex girlfriend" that he would do something like that to me. But then he told me it was true. The man I was in love with, who I thought was in love with me was fucking and texting his ex, just a day before we spent the day together at a concert. I gave up so much of my time and heart for him. It took all I had to end things and not give him another chance. How does this shit happen? And how does someone ever recover from this pain? Any tips besides "give it time"?