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