0
0
Gitdevops~10 mins

git reset soft vs mixed vs hard - Interactive Practice

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

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

Git
git reset --[1] HEAD~1
Drag options to blanks, or click blank then click option'
Amixed
Bsoft
Chard
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'hard' will discard changes.
Using 'mixed' unstages changes.
2fill in blank
medium

Complete the command to reset the last commit and unstage changes but keep them in the working directory.

Git
git reset --[1] HEAD~1
Drag options to blanks, or click blank then click option'
Amixed
Breset
Chard
Dsoft
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'soft' keeps changes staged.
Using 'hard' deletes changes.
3fill in blank
hard

Fix the command to reset the last commit and discard all changes in working directory and index.

Git
git reset --[1] HEAD~1
Drag options to blanks, or click blank then click option'
Asoft
Bmixed
Cdiscard
Dhard
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'soft' or 'mixed' will keep changes.
Using 'discard' is not a valid option.
4fill in blank
hard

Fill both blanks to describe the effect of 'git reset --{{BLANK_1}}' and 'git reset --{{BLANK_2}}'.

Git
git reset --[1] keeps changes staged, git reset --[2] unstages changes but keeps them in working directory.
Drag options to blanks, or click blank then click option'
Asoft
Bmixed
Chard
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'hard' with 'mixed' or 'soft'.
5fill in blank
hard

Fill all three blanks to complete the dictionary describing reset types and their effects.

Git
reset_effects = { 'soft': 'keeps changes [1]', 'mixed': 'unstages changes but keeps them [2]', 'hard': 'discards changes in [3]' }
Drag options to blanks, or click blank then click option'
Astaged
Bin working directory
Cindex and working directory
Dcommitted
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up where changes are discarded or kept.