I have this poor habit you know… Whenever I accumulate a lot of git stashes in some repository I just get a little maniac and start cleaning everything.
I found it sometimes even funny to open the terminal and play around with some bash to delete the stashes, look:
Well, it happens that today (a few hours ago actually) I just did this and regretted the moment I did because there was this huge feature that for some reason I had locally stashed and not committed
¯\_(ツ)_/¯.
Good news!, the commits are not actually gone until git runs garbage collection, so to check the list of commits that might still be rescued just go ahead and type:
or maybe
because you actually need to check whether your hash is somewhere referenced as a unreachable commit.
Then all you need to do once you find your stash (if you don’t know the hash I’m afraid you will have to apply stashes until you find it) is just:
Here, some cool references on git stash:
Notice that the references above are from Atlassian, which I highly recommend when it comes to quick search into a specific Git topic.
And that’s it, hope this saves you just like it saved me.
Have a nice day.