0
0
Gitdevops~5 mins

git reset soft vs mixed vs hard - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What does git reset --soft do?
Moves the HEAD to a specified commit but keeps changes staged in the index and working directory unchanged.
Click to reveal answer
beginner
What is the effect of git reset --mixed?
Moves HEAD to a specified commit and unstages changes, but keeps them in the working directory.
Click to reveal answer
beginner
What happens when you run git reset --hard?
Moves HEAD to a specified commit and discards all changes in the index and working directory, resetting everything to that commit.
Click to reveal answer
beginner
Which git reset option keeps your changes staged?
--soft keeps changes staged after moving HEAD.
Click to reveal answer
beginner
Which git reset option discards all local changes?
--hard discards all local changes in the working directory and index.
Click to reveal answer
What does git reset --soft HEAD~1 do?
AMoves HEAD back one commit and keeps changes staged
BMoves HEAD back one commit and unstages changes
CMoves HEAD back one commit and discards all changes
DDoes nothing
Which reset option unstages changes but keeps them in the working directory?
A--soft
B--hard
C--keep
D--mixed
What is the risk of using git reset --hard?
AIt may delete uncommitted changes permanently
BIt only unstages changes
CIt creates a new commit
DIt pushes changes to remote
After git reset --mixed, where are your changes?
AStaged in the index
BIn the working directory but unstaged
CDeleted
DCommitted
Which command moves HEAD but leaves both index and working directory unchanged?
Agit reset --hard
Bgit reset --mixed
Cgit reset --soft
Dgit checkout
Explain the differences between git reset --soft, --mixed, and --hard in your own words.
Think about what happens to HEAD, index (staging), and working directory.
You got /3 concepts.
    When would you use git reset --hard and what should you be careful about?
    Consider the risk of losing work.
    You got /3 concepts.