Skip to content

Instantly share code, notes, and snippets.

@dpk
Created July 19, 2016 15:55
Show Gist options
  • Save dpk/d2aae8c9a18e796581b62b310d0f5ba1 to your computer and use it in GitHub Desktop.
Save dpk/d2aae8c9a18e796581b62b310d0f5ba1 to your computer and use it in GitHub Desktop.
#!/bin/sh
# find a file by content from basically anywhere in your git history
# for when you think you lost something but hopefully not
(git stash list; git reflog) | awk '{print $1}' | xargs git grep "${@}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment