A motor operate in two modes namely motoring and braking.
In motoring, it converts electrical energy into mechanical energy, which support its motion.
In braking it works as a generator converting mathematical energy into electrical energy and thus, opposes the motion. Motor can be provided motoring and braking operations for both forward and reverse directions.