How to revert commit in Git

Did you ever create a commit that you wish never happened? Let's be honest - we all did. There is an easy way to revert it in Git.
It's as easy as performing git revert operation in console:
git revert [here comes the commit id]
Let's say, your commit id is 17hg8w. You would call it like this:
git revert 17hg8w
Note that this operation creates a new commit that reverts all of the changes instead of removing given commit from history.
Related posts
Dive deeper into this topic with these related posts
You might also like
Discover more content from this category
Ensuring that GraphQL mutations properly update your Apollo client's cache can be a bit tricky - here's how to manually control that.
In some cases, like for testing purposes, you might want to use an npm package stored on a local machine. Here is how you can do that with one simple command.
So you don’t know what’s the type of struct you’re passing somewhere? Maybe it can be one of few types and you have to distinguish them? Or any other reason… But it’s about checking the struct type. Just use one of the coolest Elixir features - pattern matching!
