# Squashing Last Few Commits

If just want to squash last few commits we can do a `Mixed` or `Soft` reset to their parent commit and recommit the changes.

\
Note: with `Mixed` reset, we have to stage the files again, whereas `Soft` will keep the files in staging area.<br>

For example, in below image, we want to squash the last two commits `WIP: Continue Fix blah blah` and `WIP: Fix blahblah`. We can right click their parent commit `my awesome changes`, select the `Reset current branch to here`, then select the `Mixed:xxx` option.<br>

![](https://1560106033-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LS9bmsupx6ftQfO0PH7%2F-LS9g-xe1CRJ8TXhLlAc%2F-LS9gH7zTvdLmUC6QgE8%2Fimage.png?alt=media\&token=30b00819-0c75-4739-a63e-0ac8fee5f652)

Commmand line:

```
git reset HEAD~2
git add <the files> # or use git add -a to add all files to staging area
git commit
```
