I would try your best to forget about it for now, otherwise you will be in a cycle of acceptance and then anxiety. I know exactly how you feel and who knows, you may surprise yourself!
As you've shown, the knowledge was there. So be proud about that! That is why I personally dislike exams because it all comes down to the day and there is so many variables that can effect your performance
Something that I try to tell my mind is something simple -
it's done. I tried my best, things didn't work out and of course I would be naturally disappointed if it didn't - who wouldn't? But you have to learn from it. What could you have done better next time round? Don't let it deter you, be determined to come back next time and smash the exam!
Anyway, I hope that's helped!