I wrote considerable code for a feature and stashed the changes in git.
After that I pushed several changes into the repository and did a git stash and apply multiple times (read over 100 times).
After almost 2 months I now want to retrieve the changes from git stash – but I cant find them no matter what.
Tried several git stash apply, git stash list, git stash list -p. Nothing works. I cant find those old stashed changes.
Wish I had taken a backup instead of trusting git to stash them...sigh...
Can anyone help?
Try this:
git stash list -p | grep 'diff --git' | grep <your file name> That will find your files in the list. It might take a while.
One thing: git stash apply does not discard a stash. After a successful apply, you should git stash drop so it dos not clutter your list. Personally, I apply the stash using git stash pop.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With