Skip to content

Instantly share code, notes, and snippets.

@inouire
Last active March 18, 2026 15:37
Show Gist options
  • Select an option

  • Save inouire/7d5c048ba71c11f36bd9f9ac61ae2316 to your computer and use it in GitHub Desktop.

Select an option

Save inouire/7d5c048ba71c11f36bd9f9ac61ae2316 to your computer and use it in GitHub Desktop.
Look for a diff element in all git history

Exact match:

git log -S "ff1c9fbf-c3b8-4da0-aa81-72b50b84f67b" --all
git show <commit_hash>

or with a regex:

git log -G "function.*login" --all

restore the file

git checkout <commit_hash>^ -- path/to/file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment