Power supply protection to charge a battery
As you've noticed it won't work with your schematic, or with just a diode, because the direction of the current is the same.

So is there some way we can say "This battery has been inserted in the wrong direction!", why yes, that would be if we read what we think is the positive terminal of the battery as less voltage than ground. Because that should never happen if it has been connected correctly.

All you need for this is an op-amp acting as a simple comparator, here's an image showing a schematic illustrating my point. The one on the left is a battery being charged correctly, on the right is a battery inserted in the wrong way not taking any considerable current.



Here's the link if you want to play around.