> 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-reword-commit-message.md).

# Rewording Commit Message in Middle

Interactive rebase needed to change the commit message for commits in middle like:

![](/files/-LS9ej-ApoQo2Sn2Tsjb)

In this case, we right click the parent commit `my awesome changes` and select the interactive rebase menu.

![](/files/-LS9epxLRU5humKqa0Yx)

Git then will popup the Editor with the content like below (the commits show in reverse order, the last is the most recent commit).

```
pick d310b7c35 WIP: Fix blah blah
pick f3ee84093 WIP: Continue Fix blah blah
pick 07ec28ec2 Fix another stupid bug
```

We now change the `pick` to `r` or `reword` (Unfortunately, we can't change the commit message here directly) and save and close the Editor.

```
r d310b7c35 WIP: Fix blah blah
r f3ee84093 WIP: Continue Fix blah blah
pick 07ec28ec2 Fix another stupid bug
```

Git will popup the Editor again asking for the new commit message for the first commit. Now put the new message and close the Editor and do the same thing for the second commit.

Commandline:

```
git rebase -i HEAD~3 
# or the parent commit SHA if it's hard to count
git rebase -i <TheParentCommitSHA>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gittutorial.gitbook.io/practical-git-via-gitextensions/rewrite-history/how-to-reword-commit-message.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
