You can search through git history not only by the text of a commit message but by the contents of the diff of commits.
This is commonly referred to as the git pickaxe and you invoke it with the -S
parameter to git log
i.e. git log -S 'public void SomeMethod
and you’ll get every commit that touched that method signature or even one that deleted it.
Some git clients will expose this as an option in a search field but if that fails the git cli lets you include additional filters like author or file path or even use regex with the --pickaxe-regex
switch.