Re: recover lost file
Junio C Hamano <gitster@pobox.com> writes:
Show 33 quoted lines
> You only said "a lost file" without giving any specifics, so it is
> totally unclear to readers of your message how strings like
> "titlesplit" and "filesplit" relate to what you are looking for. In
> the above I randomly made a blind guess that it might be a function
> name, but I may be totally off the mark.
>
> - Do you mean "I think the file I removed had a name with either
> titlesplit or filesplit in it?"
>
> - Or do you mean "I know that the file had a definition of a
> function whose name was either titlesplit or filesplit?"
>
> - Or something completely different from the above two?
>
> If I know all of the followings are true:
>
> - I had the necessary contents committed in Git;
>
> - I do not remember the filename at all, but I am sure I deleted it
> and committed the deletion some time ago;
>
> - I know the lost contents I am looking for had a string "frotz" in
> it.
>
> then I would probably try
>
> $ git log -Sfrotz --diff-filter=D -p
>
> which will look for all file deletions throughout the history,
> limiting the output to those that had string "frotz" in them.
>
> But again, it is unclear what useful clue you have to locate the
> lost file from your description, so ...
If the scenario were
- I know the file were once committed in Git;
- I do not remember the filename, but I think its name had either
"frotz" or "nitfol" in it;
then I would try this instead:
$ git log --diff-filter=D --summary -- '*frotz*' '*nitfol*'