We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Revert

Where git reset is a sledgehammer, git revert is a scalpel.

A revert is effectively an anti commit. It does not remove the commit (like reset), but instead creates a new commit that does the exact opposite of the commit being reverted. It undoes the change but keeps a full history of the change and its undoing.

Using Revert

To revert a commit, you need to know the commit hash of the commit you want to revert. You can find this hash using git log.

git log

Once you have the hash, you can revert the commit using git revert.

git revert <commit-hash>

Assignment

In your great haste and pursuit for greatness at MegaCorp™ you forgot to write a white paper and get approval from the L69 distinguished staff architect for your marketing documentation change. The L69 has requested you revert the change...

N: Revert M

This reverts commit <commit-hash>

Run and submit the CLI tests.