I have yet another example of doing a git rm -rf
without an initial commit. (I realized I had added lots of useless files and wanted to add some filters.)
For all of you who did/will do the exact mistake I made, here's the end of the story.
First off, a brief summary of what I did.
gid add .
git rm -rf
with the intent of then adding some filters in .gitignoreI tried all sort of data recovery tools; no luck. The best I could do was the following procedure.
git fsck --lost-found
possibly with --unreachable --cache
.git/lost-found/other
with all (most of?)
the original files were re-created, but without filenames. Now the problem was
how to recover the file names. Unfortunately, all the files I recovered were blobs, no roots, so I had no information about the tree structure of the directories.file
to look at the type of a file (file <filename>
), and attaches the corresponding extension to it. The problem of matching files with filenames still remains.Good luck!