The abrupt motion of the photospheric flux during a solar flare is thought to be a back reaction caused by the coronal field reconfiguration. However, the type of motion pattern and the physical mechanism responsible for the back reaction has been uncertain. Here we show that the direction of a sunspot's rotation is reversed during an X1.6 flare using observations from the Helioseismic and Magnetic Imager. A magnetic field extrapolation model shows that the corresponding coronal magnetic field shrinks with increasing magnetic twist density. This suggests that the abrupt reversal of rotation in the sunspot may be driven by a Lorentz torque that is produced by the gradient of twist density from the solar corona to the solar interior. These results support the view that the abrupt reversal in the rotation of the sunspot is a dynamic process responding to shrinkage of the coronal magnetic field during the flare.