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.
Work with a team that keeps learning and building better software every day.
Related posts
Dive deeper into this topic with these related posts
You might also like
Discover more content from this category
With pure function React Components you're not allowed to use lifecycle methods like componentDidMount or componentWillUnmount.
There is a common scenario: You'd like to debug your Phoenix app with break!/4 or IEx.pry/0. Everything works fine, until... Phoenix server throws a timeout error statement.
Sometimes we want to store some piece of information while using a terminal, for example, a result of an executed command. We usually save it into some temporary file which is going to be deleted after all. There’s a better way.

