Skip to content

Instantly share code, notes, and snippets.

@zorji
Last active June 23, 2019 08:15
Show Gist options
  • Save zorji/262008c0690774d07caf8a7130cb801a to your computer and use it in GitHub Desktop.
Save zorji/262008c0690774d07caf8a7130cb801a to your computer and use it in GitHub Desktop.
Reset Git history to initial commit
# List all commits (across all branches) for a given file
git log --all -- path
# How to revert initial git commit? http://stackoverflow.com/a/6637891/412743
git update-ref -d HEAD
git commit -m "init commit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment