Skip to content
Latchkey

git stash drop: Usage, Options & Common CI Errors

git stash drop removes one stash entry from the stack without applying it.

Drop is how you discard a stash you no longer need, or clean up after a conflicted pop. It is destructive, but a dropped stash is briefly recoverable through the stash reflog.

What it does

git stash drop deletes the specified stash entry (the latest by default) from the stack. git stash clear deletes every entry at once.

Common usage

Terminal
git stash drop                  # drop stash@{0}
git stash drop stash@{2}
git stash clear                 # remove all entries
# recover a just-dropped stash:
git stash apply <sha-from-stash-reflog>

Options

ItemWhat it does
[<stash>]Drop a specific entry (default: stash@{0})
clearRemove all stash entries
-q / --quietSuppress output

Common errors in CI

fatal: <stash> is not a valid reference - the index is out of range or the stack is empty. List first with git stash list. A dropped or cleared stash is not immediately gone; its commit lingers in the stash reflog until gc, so recovery is possible with git fsck --unreachable or the reflog SHA.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →