> 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-edit-the-last-commit.md).

# Editing the Last Commit

If not all the changes should go into the commit, we can do a `Mixed` reset to the previous commit and redo the commit with only the wanted changes.

![](https://1560106033-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LS9bmsupx6ftQfO0PH7%2F-LS9fAHqNxdACSicbwz0%2F-LS9fneh6DsQaKtX2SoL%2Fimage.png?alt=media\&token=8a546b49-eb68-4a44-8f3b-805377e506f3)

Commandl line:

```
git reset HEAD~
# add only the wanted file 
# or use interactive add to add some portions of the file
git add awesome_changes.txt 
git commit
```
