From LQWiki
tac is the same as cat, only tac shows lines in reverse. Imagine a file foo that contains:
hello
world
tac foo will print:
world
hello
to print the characters in a line in reverse you can use rev, to print both lines and characters in reverse use
tac foo | rev