← Quiz: Undoing Changes: all 10 questions
Quiz: Undoing Changes · Question 7 of 10
You committed but forgot to add one file and have not pushed. What is the simplest fix?
You committed but forgot to add one file and have not pushed. What is the simplest fix?
- A.git revert HEAD
- B.git add the file, then git commit --amend
- C.Delete the repository
- D.git reset --hard HEAD~5
Answer & explanation
Correct answer: git add the file, then git commit --amend
amend replaces the last commit with one that includes the file.
Can you get the rest right without peeking?
Take the timed Quiz: Undoing Changes quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →