Assume we have a repository and 5 commits:
And now I realize commits 4 and 5 are a bad idea. I want to completely remove all changes committed in commit 4 and 5. How to do it?
git revert commit_hash
It reverts given commit. Note that revert is another commit which discards changes from commit_hash, not removing given commit from repository.
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