After a search, a G or a jump to another file, you usually want to go back to where you were. Vim keeps a list of those spots.
Ctrl-o
Ctrl-i
Ctrl-o goes to the previous position in the jump list, Ctrl-i (or Tab, which is the same key in a terminal) goes forward again. It works like back and forward in a browser.
Not every movement counts as a jump. Searches with / and n, G, %, { and }, :tag, and commands that open another file all do. Moving with j, k or w doesn’t, so pressing Ctrl-o takes you to the meaningful spots only.
You can see the whole list:
:jumps
The line with > is where you are now. A count works too: 3 Ctrl-o goes back three entries.
The list crosses files, which I like: open a file with gf, look around, and Ctrl-o brings you back to the first one. It survives restarts too when viminfo is enabled, the default.
This is a different list from g;, which walks through places where you changed text, not places you jumped to.
Further reading: Vim help: jump motions, Vim help: CTRL-O
Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more