{"thread":{"id":"21133","subject":"Can I retrieve changes from deleted stash?","startedAt":"2009-10-05T12:05:59Z","lastAt":"2009-10-05T12:50:40Z","messageCount":3,"participants":["Daniel","Thomas Rast","mjucde"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"124244","messageId":"c18a43e.55008170.4ac9e127.2a972@o2.pl","threadId":"21133","inReplyTo":null,"subject":"Can I retrieve changes from deleted stash?","fromName":"Daniel","fromEmail":"mjucde@o2.pl","sentAt":"2009-10-05T12:05:59Z","receivedAt":"2009-10-05T12:05:59Z","isPatch":false,"sender":{"key":"mjucde@o2.pl","avatar":null},"body":"I did:\n\n$ git stash\n$ git pop\n\n$ git checkout -- <modified files>\n\nNow I don't have changes I stashed. I guess the blobs with stashed\nfiles should be somewhere?  Is there any way I can get back my changes?\nI tried to use git-reflog, but I'm not sure how can I find the files\nI need.\n"},{"id":"124246","messageId":"200910051430.17559.trast@student.ethz.ch","threadId":"21133","inReplyTo":"c18a43e.55008170.4ac9e127.2a972@o2.pl","subject":"Re: Can I retrieve changes from deleted stash?","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-10-05T12:30:13Z","receivedAt":"2009-10-05T12:30:13Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Daniel wrote:\n> I did:\n> \n> $ git stash\n> $ git pop\n> \n> $ git checkout -- <modified files>\n> \n> Now I don't have changes I stashed. I guess the blobs with stashed\n> files should be somewhere?  Is there any way I can get back my changes?\n> I tried to use git-reflog, but I'm not sure how can I find the files\n> I need.\n\nThe problem is that the stash itself is a reflog, so there is no extra\nsafety layer.\n\nRecent versions of the git-stash(1) manpage[*] document a command that\nhelps find the stashes: if you do not explicitly name them, the they\nwill be called \"WIP on <subject>\" and can thus be found with\n\n  git fsck --unreachable |\n  grep commit | cut -d\\  -f3 |\n  xargs git log --merges --no-walk --grep=WIP\n\n\n[*] you can find a bleeding edge version at\n\n  http://www.kernel.org/pub/software/scm/git/docs/git-stash.html\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"124247","messageId":"49b3d318.78c3c971.4ac9eba0.1181@o2.pl","threadId":"21133","inReplyTo":"200910051430.17559.trast@student.ethz.ch","subject":"Re: Can I retrieve changes from deleted stash?","fromName":"mjucde","fromEmail":"mjucde@o2.pl","sentAt":"2009-10-05T12:50:40Z","receivedAt":"2009-10-05T12:50:40Z","isPatch":false,"sender":{"key":"mjucde@o2.pl","avatar":null},"body":"Thomas Rast <trast@student.ethz.ch> wrote:\n\n> Daniel wrote:\n> > I did:\n> > \n> > $ git stash\n> > $ git pop\n> > \n> > $ git checkout -- <modified files>\n> > \n> > Now I don't have changes I stashed. I guess the blobs with stashed\n> > files should be somewhere?  Is there any way I can get back my changes?\n> > I tried to use git-reflog, but I'm not sure how can I find the files\n> > I need.\n> \n> The problem is that the stash itself is a reflog, so there is no extra\n> safety layer.\n> \n> Recent versions of the git-stash(1) manpage[*] document a command that\n> helps find the stashes: if you do not explicitly name them, the they\n> will be called \"WIP on <subject>\" and can thus be found with\n> \n>   git fsck --unreachable |\n>   grep commit | cut -d\\  -f3 |\n>   xargs git log --merges --no-walk --grep=WIP\n> \n> \n> [*] you can find a bleeding edge version at\n> \n>   http://www.kernel.org/pub/software/scm/git/docs/git-stash.html\n> \n> -- \n> Thomas Rast\n> trast@{inf,student}.ethz.ch\n> \n\nThanks, that did the trick :)\n"}]}