Ever started working on the wrong branch with Git? Use gist stash
! Here is how to proceed in 3 steps:
1. Use stash to detach unstaged changes:
$ git stash
2. Change branch:
$ git checkout my-branch
3. Retrieve your changes as you left them:
git stash pop
Git stash
can do much more, see its options with git stash help
.