Undo a Git commit after push using reverse patch?
I’ve pushed a commit and I want to revert changes introduced by this commit by applying and committing a reversed patch. How do I do it?
3 Solutions collect form web for “Undo a Git commit after push using reverse patch?”
Sounds like you want to use git-revert.
git revert HEAD
This will create a patch that reverts the last commit and commit that patch as a new commit.
If you want to revert a specific earlier version, use
git revert <revision>
for committed file:
git revert <SHA1 ID>
for non-committed file:
git reset --hard HEAD