Reverting Git Commits

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:03
    [Reverting Git Commits with Joe Shindelar]
  • 0:06
    [Joe Shindelar]: Every once in awhile somebody makes a mistake in their code,
  • 0:09
    and things get introduced to our code base
  • 0:12
    that simply shouldn't be there.
  • 0:14
    Commits may introduce a performance regression,
  • 0:17
    or you may have simply committed code that wasn't quite ready to go yet.
  • 0:21
    I know my coworker Kyle has done this from time to time,
  • 0:24
    and we end up with commits in our repository
  • 0:26
    that just simply shouldn't be there.
  • 0:29
    In this lesson, we're going to take a look
Loading ...

Reverting Git Commits


It happens to the best of us, sometimes we commit something that just simply wasn't ready, or maybe we're having a bad day and introduced a bug to the code. I've even seen scenarios where you've created a temporary workaround in your codebase and now you're ready to remove that workaround and put in a real fix. This lesson looks at using the `git revert` command to deal with these scenarios by creating new commits that reverse the changes of a previous commit.

Additional resources: