Scott Aaronson, Daniel Grier, and Luke Schaeffer did a paper on this a few years back...
The Classification of Reversible Bit Operations https://www.scottaaronson.com/papers/gates.pdf
Grier's ITCS presentation on it https://www.youtube.com/watch?v=egU5JLbpmkA
BTW see Lehmer codes for permutation sequences https://en.wikipedia.org/wiki/Lehmer_code (no relation to Lemire ;)