# git switch - jumps back to the previous branch

Published 2026-10-08 — git

`git switch -` returns to whichever branch you were on before, the same way `cd -` does for directories.

```bash
git switch feat/til
git switch main
git switch -   # back on feat/til
```

---

Canonical HTML: https://www.dainemawer.com/til/git-switch-dash
Markdown index: https://www.dainemawer.com/index.md · Agent guide: https://www.dainemawer.com/agents.md · [llms.txt](https://www.dainemawer.com/llms.txt)
Attribution: Daine Mawer — https://www.dainemawer.com/about