cli.fail

Practice this fail.

Undo without time travel.

Git · Restart as often as you like

Read the error, choose a command, and learn
why it works. Nothing runs on your machine.

Browse all practice ↗

Git · Intermediate

HEAD is a published, ordinary non-merge commit that should be undone. Your working tree is clean. Keep shared history and create a new reversing commit.

Undo without time travel.

$ git log -1 --oneline

cafe123 Ship the wrong default

Which command creates a new commit reversing HEAD?

3 attempts remaining

Read why this fix works

Undo without time travel.

git revert HEAD

Revert records a new commit that reverses the selected commit. It preserves the earlier commit in history, which makes it suitable for undoing a published change without rewriting the branch.

Practice rounds do not affect the daily score or local streak. Try today’s challenge, or choose another scenario.

Copy your result