Embercode
✕
Git and GitHubQuick quiz

Undo and reset

8 questions. Covers Reset, revert and what each erases.

Questions 1 to 5 of 8

  1. 1. You committed with the message Add intro paragrah, and the commit has not been pushed. Which command changes that message to Add intro paragraph without adding a second commit?
  2. 2. True or false: after git commit --amend -m "New message", the commit keeps its old ID, because only the message text changed.
  3. 3. Put these steps in the order that removes a debugging line from the newest commit, when that commit is only on your computer.

    Use the arrows to put the steps in order.

    1. 1.git commit --amend --no-edit
    2. 2.Edit greet.py and delete the DEBUG line
    3. 3.git add greet.py
  4. 4. You edited notes.txt and have not staged or committed the edits. You run git restore notes.txt. What happens?
  5. 5. True or false: git restore --staged notes.txt erases your edits to notes.txt.

4 question(s) left on this page.