Retrieve deleted stash in Git using SourceTree -


i using source tree. had created stash of multiple changes , mistake deleted it. there way retrieve them back?

the stash saved internally merge commit referenced list of stashes.

git fsck can find dangling objects. find not deleted stash, other stuff, too... you'll wanting commits stash (git show <id> display relevant info object , decide whether it's 1 you're looking for).

once have that, need re-insert list of stashes. list stored in .git/logs/refs/stash , line has following format:

<id of previous stash commit in list or 0000000000000000000000000000000000000000 if none> <id of merge commit> name <your@email.example> <unix timestamp> <time zone, e.g. +0000><tab char><description of stash> 

here's working example:

16b9a2d400dafe7ea25592029e3e5582d025c7d8 5def7605dfe625e8b3a3152fe52a87cc36694b6a jan krüger <email.censored@invalid> 1374227992 +0200  wip on master: 0dbd812 update draft release notes 1.8.4 

just synthesize line stash want re-insert (the name/mail/timestamp/description don't have accurate) , should able use again.

happy hunting!


Comments