Intermediate
Git & Version Control
Q44 / 100
What is the difference between "git reset --soft", "git reset --mixed" (default), and "git reset --hard"?
Correct! Well done.
Incorrect.
The correct answer is A) "--soft" moves HEAD to the target commit but leaves staging and working directory unchanged; "--mixed" (default) also resets staging (changes become unstaged but stay in the directory); "--hard" additionally discards working directory changes
A
Correct Answer
"--soft" moves HEAD to the target commit but leaves staging and working directory unchanged; "--mixed" (default) also resets staging (changes become unstaged but stay in the directory); "--hard" additionally discards working directory changes
Explanation
Understanding these levels is critical: "--hard" is destructive and discards uncommitted work, while "--soft" is the safest, simply moving the branch pointer while keeping all changes staged.
Progress
44/100