Hello Benoit, > > $ 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".
I lost modifications to 20 files. "git stash clean" moved these modifications into a stash named "clean", and "git stash clear" killed it. > > Is there some shorthand for this process, such as a "git-recover" > > command? > > 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). Cool! This information would be worth mentioning in the git-stash manual page or in an FAQ. It can be a real life-saver. > Someone just told me on IRC that you can also use git lost-found > (which worked for me). "git lost-found" does not work well for me: I stopped it after it ate 10 minutes of CPU time without producing a result. If you think that's a bug (endless loop?), you can find the repository I was working on at http://www.haible.de/bruno/gnulib-testgit.tar.gz Bruno