From the course: Git: Branches, Merges, and Remotes

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Reset types

Reset types

From the course: Git: Branches, Merges, and Remotes

Start my 1-month free trial

Reset types

- [Instructor] In this chapter, we're going to learn how to reset branches and we're going to begin by first looking at the three different types of resets that you can do. Reset is going to change the files in the staging index and/or the working directory to the state they had when a specified commit was made. And a simpler way to think of it is you're saying, make my project look like it did back then. What it's actually doing is moving the head pointer to a specific commit and then it may also be changing some of the files in your staging index or working directory as well. There are three types of reset. There's soft, mixed and hard. Let's look at all three of them. A soft reset is the simplest, it moves the head pointer to the specified commit but it does not change the staging index, it does not change the working directory. So essentially we're just moving the recording head where our next commit will go to another place in our commit tree. That's it, we're just moving to…

Contents