Skip to content

Instantly share code, notes, and snippets.

@abhijithvijayan
Last active September 9, 2018 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhijithvijayan/efe4cebc54db3e101c258f90af7e155c to your computer and use it in GitHub Desktop.
Save abhijithvijayan/efe4cebc54db3e101c258f90af7e155c to your computer and use it in GitHub Desktop.
Delete a Github Commit

Warning

Everything since the commit you want to revert to will be deleted once you push again.

  • Steps
  1. Find the commit number
git log
  1. Reset
git reset --hard that_commit_number

eg: git reset --hard e3263a17b4a417d79ee71b4317f10987d1b15d54
  1. Force Push
git push -f

This will revert the repo to the commit #e3263a17b4a417d79ee71b4317f10987d1b15d54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment