there are mechanical brakes, like in your car with pads, and there are electronic brakes like kak111 mentioned and is commonly found in hybrid vehicles.
the electronc break means to drive the motor in reverse while the motor is actually spinning in original direction .. (like throwing a car in reverse on the highway and hitting the gas). there is a tremendous amount of energy that has to be transfered from the motor back towards your power electronics.. i.e. motor starts acting like a generator. and if you can find a way to re-direct this energy (like recharging a battery) and/or burn it off in a resistor, then your electronic brakes can work. this is called "dynamic braking" which should help your google searches.
Mr.Cool