Practice: Undo a Mistake
Revert a bad commit and verify.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
echo bad >> a.txt && git commit -qam 'Oops'
git revert --no-edit HEAD >/dev/null
cat a.txt
git log --format=%s | wc -lResult
one 3
Exercise
Undo commit.
git HEAD
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.