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.

Table of contents

    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.

    Szymon Soppa Web Developer
    Szymon Soppa Curiosum Founder & CEO

    Read more
    on #curiosum blog