> For the complete documentation index, see [llms.txt](https://gittutorial.gitbook.io/practical-git-via-gitextensions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gittutorial.gitbook.io/practical-git-via-gitextensions/rewrite-history/how-to-squash-last-few-commits.md).

# 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>

![](/files/-LS9gH7zTvdLmUC6QgE8)

Commmand line:

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