🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Undoing Changes: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. A bad commit is already pushed and teammates pulled it. What's the safe way to undo it?
  2. Q2. Which reset keeps your changes staged?
  3. Q3. You need to switch branches but have unfinished, uncommitted work. What do you use?
  4. Q4. How do you unstage a file but keep its changes?
  5. Q5. What does git reflog help you do?
  6. Q6. Which command throws away unstaged edits in a file?
  7. Q7. You committed but forgot to add one file and have not pushed. What is the simplest fix?
  8. Q8. What does git reset --hard HEAD~1 do?
  9. Q9. How is git revert different from git reset?
  10. Q10. After git stash, how do you bring the saved work back and remove it from the stash list?