command-line - use shortcut "-" for previous dir (bash) or branch (git)
What is the bash shortcut to change to the previous directory?
A nice description here of how this works. Can be used in git as well.
From man page for bash:
When a is used as the operand, this shall be equivalent to the command: cd "$OLDPWD" && pwd which changes …