How do you rotate object to it's original position after rotating it using code?

so I have the script
if (Input.GetKeyDown(KeyCode.Space))
{
transform.Rotate(Vector3.right * rotate * Time.deltaTime);
}
I’d like it so that after it rotates (250 on the x) it returns back to it’s original rotation value 0 I’m trying to make an object rotate forward and then immediately return back so every time I click space my object rotates forward then back.

Store the original rotation value on Start() or OnEnable()

Quaternion originRotation;

void Start()
{
    originRotation = transform.rotation;
}