how to reverse lines and characters in the buffer in emacs editor

There are several different commands to sort text in the buffer. Reversing lines, words or even paragraphs is just a variation of sorting text. Reverse Lines in buffer The command to reverse text is reverse-region, and as the command indicates works on the current active region of the buffer. M-x reverse-region The reverse-region command will reverse the order of the…