Dynamic electric braking by reversing current