1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-06 16:48:01 +00:00

Add Checkout Previous Branch to git til.

This commit is contained in:
jbranchaud
2015-03-05 22:56:09 -06:00
parent ba10d91819
commit 1e84b850d5
2 changed files with 14 additions and 0 deletions

View 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)