Files
30-seconds-of-code/snippets/switch-to-last-branch.md
2021-04-13 21:10:59 +03:00

19 lines
284 B
Markdown

---
title: Return to previous branch
tags: branch,beginner
---
Switches back to the last branch.
- Use `git checkout -` to switch back to the previous branch.
```shell
git checkout -
```
```shell
git checkout patch-1
git checkout master
git checkout - # Switches to `patch-1`
```