0
0
Gitdevops~10 mins

git revert to undo a commit safely - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to revert the last commit safely.

Git
git [1] HEAD
Drag options to blanks, or click blank then click option'
Arevert
Breset
Ccheckout
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git reset' which rewrites history and can cause problems.
Using 'git checkout' which switches branches or files.
Using 'git commit' which creates a new commit but does not revert.
2fill in blank
medium

Complete the command to revert a specific commit by its hash.

Git
git revert [1]
Drag options to blanks, or click blank then click option'
AHEAD~1
Babc1234
Corigin/main
Dmaster
Attempts:
3 left
💡 Hint
Common Mistakes
Using branch names instead of commit hashes.
Using relative references like HEAD~1 when a specific commit hash is needed.
3fill in blank
hard

Fix the error in the revert command to undo the last commit safely.

Git
git [1] HEAD
Drag options to blanks, or click blank then click option'
Areset
Bbranch
Crevert
Dmerge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git reset' which can cause loss of commits.
Using 'git merge' or 'git branch' which do not revert commits.
4fill in blank
hard

Fill both blanks to revert the last two commits safely.

Git
git revert [1] [2]
Drag options to blanks, or click blank then click option'
AHEAD
BHEAD~1
CHEAD~2
DHEAD~3
Attempts:
3 left
💡 Hint
Common Mistakes
Using commits older than the last two.
Reverting commits in wrong order.
5fill in blank
hard

Fill all three blanks to revert a merge commit without auto-committing.

Git
git revert [1] -m [2] [3]
Drag options to blanks, or click blank then click option'
Aabc1234
B1
C--no-commit
D--no-edit
Attempts:
3 left
💡 Hint
Common Mistakes
Using -m without a number.
Confusing --no-commit with --no-edit.
Omitting the commit hash.