First of all, prepare yourself as best as possible for classes! This is ideal for you and for your students: they get correct information, not to mention an interesting and engaging lesson, and you don’t embarrass yourself.
If someone asks a question you can’t answer, be honest and tell them you’ll try to find out. Not all questions have the answers their askers would like.
Nevertheless, sometimes you slip up. How to clean up the carnage?
Perhaps the best strategy is to fess up right away and laugh at yourself a bit. This works if you catch your mistake right away and know the correct alternative. If I make a typo, I like to blame it on “my secretary.” It obviously looks better not to make mistakes, but it can humanize you and, if you respond appropriately, can let high level students especially realize that what they’re learning is in fact difficult.
Another strategy might be to gloss over your mistake – maybe more appropriate if you only realize it after the fact – but in this case make sure to return to it the next day and deal with it. With something like grammar, completely glossing over it is really not a good idea. It is relatively easy for students to consult some reference material and confront you with it if they so desire. What’s worse is that they’ve got the wrong information.
I’ve heard teachers with stories of making up explanations on the spot, and obviously this is not advisable. Most importantly, you are giving students wrong information, but it also seems like the energy it would take to do this well would be better spent just finding out the right answer.
Keep in mind:
You are not meant to be a walking grammar reference book. Few people are, and most students would not want to be in the classes of those few.
There are plenty of intriguing questions that just don’t have good clear answers: why can we say “pick the cup up”, “pick up the cup”, “pick it up”, but not “pick up it”? Lots of people would be happy to have the language completely conform to logic, but it just doesn’t.
Finally, while your role as a teacher is important, you will almost certainly not be your students’ first nor last English teacher. It’s ideal not to make a ton of mistakes, but your students will get through and even continue to learn and improve through a few.