Simple player rotation help

I am making a 2D game and I am trying to make my player rotate up (around the Z axis) when the A key is pressed to indicate the player has an Up force added to it then when the A key is released I am trying to make my player rotate down to represent that the player is falling.

	void Update () {
		if (Input.GetKey(KeyCode.A) && !isDead) {
			player.GetComponent<Rigidbody2D>().AddForce(Vector2.up * 25);
			zRotation = Mathf.Clamp(zRotation, -25f, 25f);
			transform.Rotate(new Vector3(0,0,zRotation));

		}
		if(Input.GetKeyUp(KeyCode.A)){
			zRotation = Mathf.Clamp(zRotation, -25f, 25f);
			transform.Rotate(new Vector3(0,0,-zRotation));
		}
}

the AddForce and the rotation works for on A down but the Mathf.Clamp doesn’t and my player will just keep doing back flips until I release the A key.

Basically my Mathf.Clamp doesn’t work in either direction and GetKeyUp doesn’t make my player rotate down to indicate falling. Can someone please help or give me a better suggestion on how to achieve the desired outcome.

Actually line

transform.Rotate(new Vector3(0,0,zRotation));

adds zRotation amount of rotation every timeUpdate function is called. This is probably why your player is doing back flips.

If you want to set your rotation to zRotation, what you should use is:

transform.rotation = Quaternion.Euler(0, 0, zRotation)