Skip to content

Instantly share code, notes, and snippets.

@itdaniher
Created October 27, 2011 01:31
Show Gist options
  • Save itdaniher/1318540 to your computer and use it in GitHub Desktop.
Save itdaniher/1318540 to your computer and use it in GitHub Desktop.
How do I use 'stash' in Git?

If you've made some changes, need to stop what you're doing, and not commit, you probably want to use git's stash feature, which saves your changes and restores you to a clean copy of HEAD.

Here's how to do it:

 git stash save

...saves your local changes.

 git stash apply stash@{0}

...restores your local changes.

 git stash drop stash@{0}

...discards your stashed changes.

["git","stash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment