Nobody truly understands quaternions, you just have to live with them, and let them do the work for you :)
Assuming, since you said "rigidbody.rotation = Quaternion.identity;" in your post, that you have tried that and, that is not what you are interested in? That one resets the rotation to the default, but does not reset the speed, so it keeps spinning.