How a dc motor is converted into generator?
Also, if it’s a “brushless” motor, running it in reverse will not turn it into a generator because the electronic components that are used to replace the brushes and control its output speed simply cannot be run “in reverse.” (this is similar for other DC motors, especially more finely-controlled ones, like DC stepper motors.