I know it's easier said than done, but stop thinking about it. There's nothing you can do about it. You can't change it no matter how much you want to. Just focus on your next exam coming up and try to perform to the best of your ability. If you haven't got any more exams coming up, then go out. Go for dessert, go to the beach, hang out with friends to try and stop thinking about it. I tend to find exercising helps me as you're focused on doing something else.
Besides, I am sure you haven't done as bad as you feel like you have.