0
0
Gitdevops~10 mins

Why recovery skills are critical in Git - Test Your Understanding

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

Complete the command to undo the last commit but keep changes staged.

Git
git reset --[1] HEAD~1
Drag options to blanks, or click blank then click option'
Amerge
Bsoft
Cmixed
Dhard
Attempts:
3 left
💡 Hint
Common Mistakes
Using --hard deletes changes permanently.
Using --mixed unstages changes.
2fill in blank
medium

Complete the command to discard all local changes in the working directory.

Git
git checkout -- [1]
Drag options to blanks, or click blank then click option'
AHEAD
Borigin
C.
Dmaster
Attempts:
3 left
💡 Hint
Common Mistakes
Using HEAD does not discard untracked files.
Using branch names won't discard local changes.
3fill in blank
hard

Fix the error in the command to recover a deleted branch named 'feature'.

Git
git checkout -b [1] origin/feature
Drag options to blanks, or click blank then click option'
Aorigin
Bmaster
CHEAD
Dfeature
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'origin' as branch name creates a wrong branch.
Using 'master' or 'HEAD' does not recover the feature branch.
4fill in blank
hard

Fill both blanks to create a stash and then apply it back.

Git
git [1] && git [2]
Drag options to blanks, or click blank then click option'
Astash
Bapply
Ccommit
Dpush
Attempts:
3 left
💡 Hint
Common Mistakes
Using commit instead of stash saves permanently.
Using push does not restore local changes.
5fill in blank
hard

Fill all three blanks to reset to a previous commit and discard all changes.

Git
git reset [1] [2] && git [3]
Drag options to blanks, or click blank then click option'
A--hard
BHEAD~2
Cclean -fd
Dcheckout
Attempts:
3 left
💡 Hint
Common Mistakes
Using --soft or --mixed does not discard changes fully.
Forgetting to clean leaves untracked files behind.