Learn
How to Backtrack
Generalizations

Congratulations! You’ve learned three different ways to backtrack in Git. You can use these skills to undo changes made to your Git project.

Let’s take a moment to review the new commands:

  • git checkout HEAD filename: Discards changes in the working directory.
  • git reset HEAD filename: Unstages file changes in the staging area.
  • git reset commit_SHA: Resets to a previous commit in your commit history.

Additionally, you learned a way to add multiple files to the staging area with a single command:

git add filename_1 filename_2

Instructions

Click Next to finish the lesson!

Folder Icon

Sign up to start coding

Already have an account?