Practice Quiz: Undoing Things

6. Let's say we've made a mistake in our latest commit to a public branch. Which of the following commands is the best option for fixing our mistake?

  • git revert
  • git commit –amend
  • git reset
  • git checkout — <file>

7. If we want to rollback a commit on a public branch that wasn't the most recent one using the revert command, what must we do?

  • Use the git reset HEAD~2 command instead of revert
  • Use the revert command repeatedly until we’ve reached the one we want
  • use the commit ID at the end of the git revert command
  • Use the git commit –amend command instead

8. What does Git use cryptographic hash keys for?

  • To secure project backups
  • To guarantee the consistency of our repository
  • To encrypt passwords
  • To identify commits

9. What does the command git commit --amend do?

  • Start a new branch
  • Create a copy of the previous commit
  • Delete the previous commit
  • Overwrite the previous commit
  • git show
  • git identify
  • git log
  • git revert

Devendra Kumar

Project Management Apprentice at Google

Leave a Reply