Two things.
First, in your shoes, I'd go talk to the professor and see how you're actually doing. Don't say anything about needing an A for med school - profs hate that. Just state your concern that you're not doing as well as you expected and you'd like insight into how to do better. What are the A students doing that you're not doing, etc. Highly recommended: actually listening and trying what the prof says.
Second, getting crushed by exams like this is unbearably normal in med school. You're going to get more out of this (potential) C than you ever got out of an A. Use the experience to figure out what happens when you get crushed, so that you know what to do in med school.
Depending on what the prof says about your probable grade, you're going to have to be ready to explain this repeat, regardless. If you choose to stick with it and keep the C, you can use the experience to improve your skills. That's a better story than a W, imho.
From a GPA perspective, repeating a B is gambling. For MD schools, both grades will be averaged together. For DO schools, a lower grade on a repeat might not get forgiven...
Best of luck to you.