Vehicle movement: fall back onto wheels

I have a simple car with movement forwards, reverse and turning (rotating around Z) to user keypress (arrow keys).
The car can climb ramps and things. The problem is, sometimes it tumbles. When it does, it might stop at a diagonal position and then forward, back etc sent it in odd directions, even into the air at a diagonal angle.

How do I make the car fall back to the floor, landing flat on its tyres once it’ been over a ramp / taken a tumble?

In python use alignAxisToVect() to align object Z axis to world Z axis [0, 0, 1]