Every permutation has an inverse, which is also a permutation.
The perminv command computes the inverse of a permutation.