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?
You can use the Git reset command to undo a merge. Firstly, you need to check for the commit hash (or id) so you can use it to go back to the previous commit. To check for the hash, run git log or git reflog . git reflog is a better option because things are more readable with it.
Use
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>
see also: http://schacon.github.com/git/git-revert.html
Sounds like you want to use git-revert.
https://www.kernel.org/pub/software/scm/git/docs/git-revert.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With