If you happen to be in vim
use
:g/^/m0
Explanation from @Ronopolis below:
g
means "do this globally.^
means "the beginning of a line".m
means "move the line to a new line number.0
is which line to move to.0
means "top of the file, before the current line 1".
So: "Find every line that has a beginning, and move it to line number 0."
You find line 1, and move it to the top. Does nothing. Then find line 2 and move it above line 1, to the top of the file. Now find line 3 and move it to the top. Repeat this for every line. At the end you finish by moving the last line to the top. When you are done, you've reversed all the lines.