Rotate a object back to original rotation

I have a animation that spins my object and with the press of a button I am trying to rotate the object back to its original rotation during a time span of 90 frames. I am trying to accomplish this by using this: object.rotation.y += (0- object.rotation.y) / 90. But the problem is that half of the time the object rotates to its back. I have been stuck with this problem for days so any help would be appreciated.

Do not user euler angles for animations. Use quaternions.

Save the original orientation in a quaternion. When you want to animate the orientation back to its original state, use Quaternion.rotateTowards(). Besides, do no measure the length of your animation in frames but seconds. Otherwise your animation won’t be equal on devices with different frame rates.

There is also an official example that demonstrates the above approach: webgl_math_orientation_transform.