Skip to content

Instantly share code, notes, and snippets.

@nepsilon
Last active May 18, 2017 08:44
Show Gist options
  • Save nepsilon/4af211d5491c5a24d1a9 to your computer and use it in GitHub Desktop.
Save nepsilon/4af211d5491c5a24d1a9 to your computer and use it in GitHub Desktop.
Ever started working on the wrong branch with Git? — First published in fullweb.io issue #6

Git stash

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment