1

Using git, is it possible to search on insertions or deletions?

Example: let say that someone from the team has deleted a function, but we just noticed it now, and then we don't know if that was deleted yesterday or if it was 6 months ago, as everyone work on every part of the system we don't even know who was. How would you recover this deleted code using Git?

peterpeterson
  • 1,182
  • 2
  • 12
  • 34
  • Try looking at [this](http://stackoverflow.com/questions/215718/reset-or-revert-a-specific-file-to-a-specific-revision-using-git) – Grice Sep 29 '14 at 16:21
  • I have been looking for a way to search thought insertions and deletions. I often insert and delete thoughts. Can you provide more details? –  Sep 29 '14 at 16:44
  • possible duplicate of [How to grep (search) committed code in the git history?](http://stackoverflow.com/questions/2928584/how-to-grep-search-committed-code-in-the-git-history) – Wooble Sep 29 '14 at 17:12

1 Answers1

1

Do a google search of "git pickaxe", or pass the string to `git log -S

-S<string>
Look for differences that introduce or remove an instance of <string>
Andrew C
  • 11,594
  • 4
  • 44
  • 52