Original: The reverse process, that of using mechanical energy to produce electrical energy, is accomplished by a generator or dynamo.
Simplified: A dynamo or an electric generator does the reverse: it changes mechanical movement into electric energy.