Posts
read more
Git: Deleting Multiple Commits
Let’s say that you want to delete the last 3 commits that you’ve already pushed to the remote repository. In this example, you want 566dab6 to be the new HEAD revision.
$ git log --pretty=oneline --abbrev-commit57bc36b (HEAD -> master, origin/master, origin/HEAD) 3nd set of bad entries on 6th commitdfb4bd3 2nd set of bad entries on 5th commit0fd1e16 First set of bad entries on 4th commit566dab6 Yet more good entries on third commitd50370a More good entries on second commitb5fbc6d Good entries on first commit2cad4c7 Initial commit