git stash — Save Uncommitted Changes
git stash temporarily saves uncommitted changes to a stack so you can switch context with a clean tree. push (default) saves WT/index, pop retrieves it, and -u also stashes untracked files.
Open the interactive DevRef Hub tool →Key facts
| Save | git stash push -m "WIP feature" |
|---|---|
| Restore & delete | git stash pop |
| Restore only | git stash apply --index stash@{0} |
| Include untracked | -u, --include-untracked |
Frequently asked questions
What does git stash do?
It shelves uncommitted changes so your working tree is clean.
git stash pop vs apply?
pop restores and deletes the stash; apply restores but keeps it.
Related pages
git stash is part of DevRef Hub on GOAT Lab — a free reference you can use without signing up, and it works offline. Open the tool above for any custom value.
Part of GOAT Lab — 26 free, browser-based science, engineering and developer tools. No sign-up.