Menu +

Search Posts

How to backtrack in Git

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

  • 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

Leave a Reply

Your email address will not be published. Required fields are marked *