Brian Lovin
/
TIL

TIL on February 2, 2026

cd -

cd - takes you back to your previous directory, like a navigation undo in the terminal.

~/projects   $ cd /etc
/etc         $ cd -
~/projects   $

No more spamming cd .. or retyping full paths.

Same pattern works with git checkout -—switches to your previous branch.