If you prepare far enough in advance then this won't happen. If you know the material, regardless of how much of a mind blank you have in the hour before the exam, you will be able to answer exam questions and answer them well. Of course, there are always going to be little things you forget, but being familiar and comfortable with the material is key. This is coming from someone whose panic attacks are triggered by exams btw. If you know you get serious exam anxiety, then you just need to start revising earlier than everyone else to make sure you're are prepared as you could've ever been.