This is the situation: I've lost some work in my git repository, this work was once commited, but is now burried in my history, somewhere that might be unreachable by 'git log --all'. The only thing I've can remember is some distinct string that could pinpoint a file that is part of my work at this time.
I've got a solution... but it is quite long, have you a better solution ?
This is my solution:
I've managed to find my commit SHA1 by batching several command:
- first finding all 'blob' objects in the .git/objects, 'git cat'ing them (and using grep) to find the SHA1 of the blob that contained my file.
- Then I had to parse all 'tree' objects to find which contained the SHA1 of the file... up to the tree object that was contained in no other 'tree' objects.
- To finally parse all commit that contained this root tree.