How do you get stashed changes back in Git?

Git · History & Undo · updated 2026-08-23

git stash pop — Apply stash

git stash pop re-applies the most recent stash and removes it from the stash list. The stash is created with git stash, and git stash list shows every saved entry if there is more than one.

pop applies the stash and deletes it from the stash list in one step; apply does the same but keeps the entry, which is the safer choice when you want to apply one stash onto several branches. If a pop hits conflicts, the stash entry is kept automatically so nothing is lost.

git stash list shows every entry with its index - target an older one with git stash pop stash@{2}. Naming stashes at save time (git stash push -m "wip login form") makes that list actually readable a week later.

Related Git shortcuts: History & Undo

ShortcutActionNotes
git logCommit historyShow commit history.
git log --onelineOne-line logShow commits in one-line format.
git diffShow diffShow unstaged changes.
git reset HEAD [file]UnstageUnstage a staged file.
git reset --hard HEAD~1Undo last commitCompletely undo the last commit.
git stashStash changesTemporarily save current changes.
git stash popApply stashRestore stashed changes.
git cherry-pick [hash]Cherry-pickApply a specific commit to current branch.

From the Git reference (24 entries) · all how-to answers

pop versus apply

git stash pop applies the most recent stash and deletes it from the list if the apply succeeds; git stash apply applies it and keeps it, which is safer when the same changes are needed on more than one branch or when you are not sure the apply will be clean. If pop hits a conflict, the stash is kept until the conflict is resolved and you drop it by hand with git stash drop.

Choosing a stash

git stash list shows entries as stash@{0}, stash@{1} … with the branch and commit message they were taken from; git stash show -p stash@{1} previews one as a diff, and git stash pop stash@{1} restores a specific entry. Stashing with a message — git stash push -m "wip: login form" — is the habit that makes the list readable a week later.

What a stash does and does not include

By default a stash saves tracked changes, staged and unstaged, and leaves untracked files in place; -u includes untracked files and -a even ignored ones. Restoring puts everything back as unstaged unless --index is given, which recreates the staged state. A stash is a commit under the hood, so a dropped stash can be recovered from git fsck --unreachable if it was recent.