Reverse polarity protection for analog input pin
The pin has built in protection diodes to its supplies. So the usual method is to use a resistance between what your measuring and the micro to limit the current. Ideally look up what the adc input impedance needs to be. Pick something slightly less than that and check if less than say 1mA can flow through those protection diodes to keep thing safe over hundreds of encounters.

The other method would be a p-mosfet in series with your positive battery terminal. If the polarity is wrong it open circuits the battery so your circuit only sees the negative spike for a moment. You still need to protect against it like above. But it means leaving it in backwards will not strain your circuit for a longer period of time.