There are a few ways to add reverse polarity protection to a circuit. One easy way is to add a diode inline with the power line.

Note that this will cause a voltage drop in the power when it reaches the resistors and diodes. If the diode has a forward voltage of 0.7 V, then the power rail will be at 4.3 V, which is still good enough for our LEDs.
When we test this in our simulator, we see that the green light stays on with correct voltage:

But the red LED stays off when the voltage is reversed:

If you're interested in learning more about reverse polarity protection and other methods, you can read this article.