On Oct 2, 2007, at 3:47 AM, Bruno Haible wrote:
Hi,$ git stash $ git fetch $ git rebase origin/master $ git stash apply <resolve conflicts> $ git stash clear $ git resetNote that "git stash clear" is a dangerous command. I recommend to use itonly after "git stash list" and/or "git status". I just did this: $ git stash $ git pull $ git stash apply $ git stash clean ; typo! $ git stash clear ; fatal correction to typo!and lost 20 modified files. Well, not really lost. Just took me a while to
I don't really see how and why you "lost 20 modified files".
recover them by - looking for the most recently changed files in .git/objects/, - use "git cat-file blob xxxx" on each, - assign the blobs to file names.Is there some shorthand for this process, such as a "git-recover" command?
Normally you can use git-reflog for this sort of mistake but stashes are implemented with reflog so it's not possible to recover through this mechanism. On the other hand, you can run git fsck and look for a dangling commit (which can be inspected with git show <sha1>) where you are most likely to find your stash (unless you run git-gc or this sort of thing).
Someone just told me on IRC that you can also use git lost-found (which worked for me).
Cheers, -- Benoit Sigoure aka Tsuna EPITA Research and Development Laboratory
PGP.sig
Description: This is a digitally signed message part