mirror of
https://github.com/jbranchaud/til
synced 2026-01-02 22:58:01 +00:00
Add Checkout Previous Branch to git til.
This commit is contained in:
@@ -9,6 +9,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
|
||||
### git
|
||||
|
||||
- [Checkout Previous Branch](git/checkout-previous-branch.md)
|
||||
- [Intent To Add](git/intent-to-add.md)
|
||||
- [Staging Changes Within Vim](git/staging-changes-within-vim.md)
|
||||
- [Stashing Untracked Files](git/stashing-untracked-files.md)
|
||||
|
||||
13
git/checkout-previous-branch.md
Normal file
13
git/checkout-previous-branch.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Checkout Previous Branch
|
||||
|
||||
Git makes it easy to checkout the last branch you were on.
|
||||
|
||||
```bash
|
||||
$ git checkout -
|
||||
```
|
||||
|
||||
This is shorthand for `git checkout @{-1}` which is a way of referring to
|
||||
the previous (or last) branch you were on. You can use this trick to easily
|
||||
bounce back and forth between `master` and a feature branch.
|
||||
|
||||
[source](http://stackoverflow.com/questions/7206801/is-there-any-way-to-git-checkout-previous-branch)
|
||||
Reference in New Issue
Block a user