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 form | What it does |
|---|---|
push -m MSG | Stash with a descriptive message |
-u, --include-untracked | Also stash new files that are not tracked |
list | Show all stashes |
pop | Reapply the newest stash and remove it from the list |
apply | Reapply a stash but keep it in the list |
drop | Delete a stash |
Examples
git stash
Saved working directory and index state WIP on main: 3f2a9c1 Add contact form
git stash push -u -m "half-done search"
git stash list
stash@{0}: On main: half-done search
git stash pop
git stash apply stash@{1}
Notes
- By default new (untracked) files are not stashed. Add -u.
- If pop hits a conflict, the stash stays in the list so nothing is lost.
- Stashes are local. Do not rely on them for long-term storage. Make a branch if the work matters.
See also
Last reviewed 2026-10-09.