Skip to content

CLI Stash Pop

github-actions[bot] edited this page Aug 16, 2026 · 1 revision

quinjet stash pop

Applies one stash and drops it, or the newest one when no reference is given.

Usage:

quinjet stash pop [REFERENCE] [-C <DIR>] [--json]

Arguments:

Name Type / values Default What it does
[REFERENCE] stash@{N} the newest stash The stash to pop. Optional: with nothing here, Git pops stash@{0}.

Options:

Name Type / values Default What it does
-C, --path <DIR> path . The repository to act on. Global.
--json flag off Prints the result sentence as one JSON object instead of a line of text.
-h, --help flag off Prints this verb's help on stdout and exits 0.

pop is the only verb in the group whose reference is optional, and the omission is passed through rather than resolved: Quinjet appends no reference at all and lets Git default to the newest entry. The two forms are:

git stash pop --index
git stash pop --index stash@{1}

That distinction matters in a repository somebody else is also using. Reading stash list and then popping stash@{0} is a race, because a push in another window renumbers the entries between the two commands. Popping with no reference is not: whatever the newest entry is at the moment Git runs is the one that goes. Use the bare form when the intent is "the last thing I stashed".

When a reference is given it is validated first, exactly as in apply: stash@{ then ASCII digits then }, or the verb fails with refusing to use an invalid stash reference and exit 1 without running Git. A well-formed reference that does not exist reaches Git and fails there instead.

--index is always passed and cannot be turned off, so the staged half of the stash returns to the index. A pop only drops the entry if the application succeeded, which is Git's behavior rather than Quinjet's: a conflicting pop leaves the conflicted files in the working tree and keeps the stash, so nothing is lost, and the conflict is then a job for quinjet resolve. A pop whose index could not be restored fails with exit 1 and can leave the working tree partly changed.

With no stashes at all there is nothing to default to, and Git says so:

$ quinjet stash pop
error: Git command failed: No stash entries found.

That is exit 1. A successful pop renumbers everything after the entry that went, so any reference held from before the pop now points at different work.

--json shape, an object with one key. The sentence differs between the two forms, because with no reference there is nothing to name:

{
  "message": "Popped latest stash"
}
{
  "message": "Popped stash@{1}"
}

Neither sentence reports what changed in the working tree. Follow with quinjet status for that.

Examples:

quinjet stash pop
quinjet stash pop 'stash@{0}'
quinjet stash pop 'stash@{2}' --json
quinjet stash pop -C ~/code/project
$ quinjet stash pop
Popped latest stash

Where to go next

CLI reference

Repository
Changes
Remotes
Branch
Stash
Pull Request
Generated
Graft
Mcp
Project
Remote
Stack
Worktree

Guides

Optimization

Git Internals
Diff
Github
Rendering

Rust practices

Studies
Patterns

Clone this wiki locally