Reverse
Turn the input back to front.
The palindrome above
Leigh Mercer published it in Notes and Queries in November 1948, and the credit has stayed with him. Reversed character by character it returns as amanaP :lanac a ,nalp a ,nam A. A palindrome reads the same both ways only once you discard the spaces, the punctuation and the case. Everything survives here, so what comes back is the exact mirror.
The three units
Character walks the entire input backwards, punctuation and spacing included. Word keeps each word intact and puts the words in the opposite order. Line keeps each line intact and puts the lines in the opposite order, so the last line of a log comes out first. Whichever unit you pick, running it twice returns the original.
Word mode treats a run of whitespace as one separator and reverses the separators along with the words, so a double space comes back on the other side of its neighbor. A newline counts as whitespace, so words cross line breaks freely: two lines reading alpha one and bravo two come back as two bravo and one alpha. Pick line when the words have to stay on the line they started on.
Characters built from more than one code unit
Character mode steps through code points rather than UTF-16 units, so an emoji occupying a single code point comes back whole and a surrogate pair is never split down the middle.
Combining marks and flags still come apart. A letter written as a base plus a combining mark, n followed by U+0303 rather than a single ñ, hands its accent to whichever character used to precede it: a decomposed mañana reverses to anãnam. A flag is a pair of regional indicator letters, so reversing swaps them and the sequence for US comes back as the sequence for SU.
Where it turns up
Reversing a string is the cheapest way to keep a literal out of a scanner. Obfuscated JavaScript stores lave and flips it before calling it, and malware samples hide domains the same way. It stops nobody who reads the code, which is why it is worth recognizing on sight and undoing in one click.
Related
Unicode normalize composes loose accents back onto their letters, which is what to run first when the marks matter. Inspect reports what a string really holds, including the right-to-left overrides that reverse text on screen without moving a byte. Bitwise operation is the other throwaway obfuscation you meet in the same places.