It's hard to take, but there are two ways of looking at this.
1. You don't know anything and you're doomed to fail.
2. The mock has exposed weaknesses in your understanding and exam technique, which you can use to help develop some kind of revision plan to rectify these areas that you thought you knew so that come the real thing you are ready, and you will be absolutely fine
In all honesty whichever one you believe you are probably going to be right - if you don't believe that you can achieve the grades you want you most likely won't, but hopefully you will be in the latter category. Take the time to properly look over your paper and work out exactly what went wrong, and do the work necessary to address these areas and the holes in your understanding. It's not going to be easy by any stretch of the imagination but you really have to try and put it behind you and make sure that come exam time you are better prepared for whatever they throw at you. Best of luck