From the course: Complete Guide to Git

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Mixed reset

Mixed reset

- [Instructor] In this movie we will learn how to perform a mixed reset. A mixed reset is going to be similar to what we just saw with a soft reset. It also moves the branch and the head pointer to the specified commit, but it also changes the staging index so that the files there also match what's in the repository. It does not change the working directory, though. We'll see the difference between them in just a moment. Now if we don't specify the type for a reset, if we just use git reset without using any kind of option, the mixed reset is going to be the default option. So you can use git reset --mixed and then the commit, or just git reset without any option and you'll get the same effect. So what will happen is that it'll change the repository state but leave all the changes in the working directory instead of in the staging index. So it's the same as a soft reset just without any stage changes. This is most useful for reorganizing commits. In the last movie I created a reset…

Contents