Skip to content
CodeKruPro

git reset --soft, --mixed and --hard

QuizMediumAsked in: Accenture, Capgemini, TCS, Wipro

You made a local commit you have not pushed. You run git reset --soft HEAD~1 (HEAD~1 means one commit back). What is the result?

  • The commit is undone, and its changes stay staged, ready to commit again
  • The commit is undone and its changes are unstaged but still in your files
  • The commit and all its changes are thrown away
  • A new commit that undoes the old one is created

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in