Having observed this situation before, if it had eaten away at you that much and made everything seem terrible, it's better that you told. Now you both know where you each stand and you can move forward.
Well, i guess kudos for at least coming forward about it. But you're still shitty for cheating in the first place. Telling the truth AFTER hiding a lie doesnt make the lie any less terrible.
Hopefully you can work things out. Most relationships don't survive long afterwards, but my relationship with my boyfriend is living proof that it CAN be done, if both people care enough to put the effort into fixing things.