Skip to content

Instantly share code, notes, and snippets.

@ihfazhillah
Forked from nepsilon/git-stash.md
Created May 17, 2017 10:05
Show Gist options
  • Save ihfazhillah/118699e11d715c2813484446f092cf9f to your computer and use it in GitHub Desktop.
Save ihfazhillah/118699e11d715c2813484446f092cf9f 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