git stash apply specific index 1

git stash apply specific index

// Get a list of stashes
git stash list

// Apply specific stash index
git stash apply stash@{n}

// Since version 2.11 you can do:
git stash apply n

Here is what the above code is Doing:
1. git stash save – saves the current state of the working directory and the index to a new stash.
2. git stash list – lists all the stashes.
3. git stash apply stash@{n} – applies the stash at index n.
4. git stash apply n – applies the stash at index n.

Similar Posts