A generator requires effort to crank so it provides current to a load. The greater the power output, the harder it is to turn the generator. I think that is the braking action.
So you could aim the vehicle downhill and let it roll down the hill charging the battery. The wheels turn the motor which provides voltage. The vehicle's speed is slowed by braking action of the motor due to the force required to turn it.
The principle is the same when charging a capacitor from a motor. Stop spinning the motor, and the capacitor continues to spin the motor for a while in the same direction as when it charged the capacitor.
You do not need to reverse direction of the motor, nor reverse the wires between motor and battery. You do need to spin the motor fast enough to overcome battery voltage. Or else introduce a step-up converter.