git stash apply version

The keys into the stash are actually the [email protected]{n} items on the left. So try:

git stash apply [email protected]{0}

(note that in some shells you need to quote "[email protected]{0}", like zsh, fish and powershell).

Since version 2.11, it’s pretty easy, you can use the N stack number instead of using [email protected]{n}. So now instead of using:

git stash apply "[email protected]{n}"

You can type:

git stash apply n

To get list of stashes:

git stash list

In fact [email protected]{0} is a revision in git that you can switch to… but git stash apply ... should figure out how to DTRT to apply it to your current location.

Leave a Comment