Skip to content

Exercise Reverting a commit

Robert Adams edited this page Sep 8, 2018 · 3 revisions



Often you might have committed something, pushed it, and then realized "crap! I actually don’t want that".

As an example, one of the CS61 TFs is offended by commit 4b40046 ("Adding aliases"). Run git show 4b40046 to see the changes:

revert diff

Your task is to figure out how to revert commit 4b40046. Use Google. Your end result if you run git lg should look like this:

revert history

And the contents of names.txt should look like this:

revert cat

Once you've finished, push your changes! git push origin master

Finish Bootcamp

Go back to the main page.