Question: After mistakenly staging a file named myFile to the index, how would you remove it from the index to exclude it from your next commit?

  1. Use git reset HEAD^.
  2. Use git reset myFile.txt.
  3. Use git -rm myFile.txt.
  4. Use git reset.

Answer: The correct answer of the above question is Option B:Use git reset myFile.txt.