Question: What does the following command do to the git repository?
- It deletes all previous commits and reset the repository history back to its initial state.
- It resets the working branch to the first commit.
- It keeps the HEAD at the current commit, but clears all previous commits.
- It sets HEAD to the previous commit and leaves changes from the undone commit in the stage/index.
Answer: The correct answer of the above question is Option D:It sets HEAD to the previous commit and leaves changes from the undone commit in the stage/index.