I also avoid using rotate() with more than one of the values set because
it's not obvious what order they will be applied in. While it's not hard
to find out, it makes things less readable (and leads to confusions as
expressed in the original post).
If you are going to use it that way, having a module for unrotate() that
applies the rotations in the correct reverse order as previously
suggested is definitely the way to go.
I also avoid using rotate() with more than one of the values set because
it's not obvious what order they will be applied in. While it's not hard
to find out, it makes things less readable (and leads to confusions as
expressed in the original post).
If you are going to use it that way, having a module for unrotate() that
applies the rotations in the correct reverse order as previously
suggested is definitely the way to go.