# Rewording Commit Message in Middle

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

![](https://1560106033-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LS9bmsupx6ftQfO0PH7%2F-LS9ePdhw3DUE5K8WNln%2F-LS9ej-ApoQo2Sn2Tsjb%2Fimage.png?alt=media\&token=50291876-dea2-420a-acfa-fde1ebbc5f69)

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

![](https://1560106033-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LS9bmsupx6ftQfO0PH7%2F-LS9ePdhw3DUE5K8WNln%2F-LS9epxLRU5humKqa0Yx%2Fimage.png?alt=media\&token=e9a29027-aca1-4e24-a4b5-d6b7c25fad25)

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

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

The question should be specific, self-contained, and written in natural language.
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.
