Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. Git commands & settings
  6. Git stash commands
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

Git stash commands


Stash current changes

$ git stash save

The stash command saves your local modifications and reverts the working directory to match the HEAD commit.

You may choose to omit save. If you do specify save, you can enter a message to label the stash content (e.g., git stash save “making a big change”).

Show stash list

$ git stash list

Recover changes from stash

$ git stash pop

The latest stash will be restored on your current work.

Adding a parameter of the stash ID (eg. stash@{1}) will restore this specific stash to your current work.

Delete stash

$ git stash drop

The latest stash will be deleted.

Adding a parameter to the stash ID (eg. stash@{1}) will delete this specific stash.

Delete all stashes

$ git stash clear

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life