2 ms·
> As long as code has ever made it into that tree (by being in any commit at any time), it's recoverable, and reflog lets you trace your steps back to any point
by Boulth 8y ago
> As long as code has ever made it into that tree (by being in any commit at any time), it's recoverable, and reflog lets you trace your steps back to any point in the past on that tree.
Actually it's enough for the file to hit index (staging area) to be recoverable.
- u801e 8y agoTrue, but finding the right sha1 is a bit more difficult in that case (given that blobs and trees don't have much metadata associated with them when compared to commits and annotated tags).
- jolmg 8y agoDo you mean it as recovering it while it's still in the index, or is it possible to add a file to the index, remove it from the index, let days of commits pass and still recover it? If the latter, how do you do that?
- Boulth 8y agoOnce you add it to index it's in .git/objects. You can find it using `find` with modification date parameter. The name will be a hash but you can look at the contents. (there will also be a tree object with file names).