git log (-S
git log (-S <text> | -G <regex> | --author=<name> | --grep=<text>)
Risk: Safe
What it does
Finds commits by what they changed, who made them, or their message.
When to use it
To find when a line or word came in or went out.
Example
$ git log -S "TODO" --onelineShow commits that added or removed the word TODO.
$ git log -G "phone|Call" -pShow commits whose changed lines match, with their changes.
$ git log --author=Aisyah --onelineShow only the commits Aisyah made.
$ git log --grep=footer -i --onelineShow commits whose message says footer, in any case.
Learn it in: Search your history · Official docs