git stash Shelve uncommitted work to come back to later

Saves your uncommitted changes on a stack and gives you a clean working folder. Use it when you need to switch branches or pull but are not ready to commit.

Synopsis

git stash [push] [OPTION]...
git stash pop | apply | list | drop

Common options

Option or formWhat it does
push -m MSGStash with a descriptive message
-u, --include-untrackedAlso stash new files that are not tracked
listShow all stashes
popReapply the newest stash and remove it from the list
applyReapply a stash but keep it in the list
dropDelete a stash

Examples

Shelve everything you are working on
git stash
Saved working directory and index state WIP on main: 3f2a9c1 Add contact form
Stash with a name and include new files
git stash push -u -m "half-done search"
See what is shelved
git stash list
stash@{0}: On main: half-done search
Bring the work back
git stash pop
Restore an older stash
git stash apply stash@{1}

Notes

See also

Last reviewed 2026-10-09.