I've been in the position of your girlfiend. I was with someone for nearly 3 years, until he suddenly told me he wasn't attracted to me didn't want to be with me anymore. I was devastated and ended up sleeping with a friend a few days later. He then told me he'd been planning on getting back with me but I'd "ruined" my chances. It hurt a lot. He didn't care.
If she really wants to get back with you, that other fling was probably nothing, and it's just something you're going to have to get over (hard as that is). I know it sucks to accept what she did but people do stupid things sometimes when they're feeling low. If she had the guts to admit what she did is a sign she trusts you and values you what you have together.
The only advice I can give you is to think about how much you love her. If it's enough, you should be able to find the strength to overcome it. But don't let her believe she has a chance with you if you have no intention of giving her that. That just makes things horribly complicated and difficult to let go of.
I know I'd have given anything to get a second chance from my ex, but I guess he didn't love me enough to think I deserved it. I really hope you can work things out with your girlfriend.