Well there is one type of encryption that uses XOR. Hence the name, XOR encryption. That operator is reversible. As you notice, 5 >> 1 by itself isn't reversible since you don't necessarily know how you got to 2; it could be any multiple of 2 was the original number. If shifting is part of an encryption algorithm, it is in a portion of the algorithm where getting the data back isn't important (e.g. you're generating keys for immediate/later use) and as long as you can start the process with the same input data, it will be right.