Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: How to get stash before the last stash?

Tags:

git

git-stash

I've been working on a branch in git, I then stashed some stuff. After some switching around branches I got back to my initial branch, made some new changes, stashed them, and then realised I wanted to go back to the changes I made before I stashed the first time.

So my question; is there a history of stashes, and if so, how do I get back to one of these?

like image 445
kramer65 Avatar asked Sep 02 '25 17:09

kramer65


1 Answers

Use git stash list and choose appropriate stash in git stash apply <stash-id>

like image 161
user3159253 Avatar answered Sep 05 '25 07:09

user3159253



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!