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.

Mixed reset

Mixed reset

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

Start my 1-month free trial

Mixed reset

- Once we know how to preform a soft reset, you'll see that a mixed reset is very similar. Lets first remind ourselves, the mixed reset is going to move the head pointer but its also going to make changes so the staging index matches the repository. That is at the point where that head pointer is. But it's not going to make any changes to our working directory. Everything will still stay the same as it was there. The way we're going to call it is with git reset and then the dash dash mixed option and provide a tree-ish as an argument. Such as a branch name, a tag, or a commit SHA. And a mixed reset is also the default choice. If we specified no option. If we left out dash dash mixed it would be a mixed reset by default. So why would we use a mixed reset? A mixed reset allows us to return to an old state, just like a soft reset does, and it leaves code changes in the working directory. Not in the staging but in the working directory. It's most useful for reorganizing your commits…

Contents