Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to drop a specific stash from the stash list in git? [duplicate]

With git stash list, I see the list of stashes, Is it possible to drop a stash from somewhere in the middle of the stash list and not from the top.

like image 471
vinodsaluja Avatar asked Dec 29 '25 13:12

vinodsaluja


1 Answers

Sure, git stash --help says:

   git stash drop [-q|--quiet] [<stash>]

So you can specify a stash to drop (with the default being the most recent stash). For example:

git stash drop stash@{5}

stash@{5} is the sequential label as shown in git stash list. Note it is not stable over time--once you drop stash 5, stash 6 will then be called stash 5.

like image 183
John Zwinck Avatar answered Dec 31 '25 09:12

John Zwinck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!