# git_ui: Better handle commit message amend \(\#35268\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/8527dcfc652776d3c5d7ade5151c0fdd96801679)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 8527dcfc652776d3c5d7ade5151c0fdd96801679

Requested commit: 8527dcfc652776d3c5d7ade5151c0fdd96801679

Commit: 8527dcfc652776d3c5d7ade5151c0fdd96801679

Tree: 963c05f72734a4695fb0beaede8b7d92d3bf4c00

Author: Umesh Yadav

Committer: GitHub

## Message

```
git_ui: Better handle commit message amend (#35268)

Follow up to this: #35114

* Previously we were still showing the commit message even after
cancelling amend which was the old commit message.
* This PR fixes that by restoring the commit message to the old state
before the amend begin so that in case user typed a commit message it's
shown if not then it's not.

Before:


https://github.com/user-attachments/assets/e0edcfff-863d-4367-a7c4-8a2998e702ca

After:



https://github.com/user-attachments/assets/9daf9be0-8a3d-4914-91a4-567693711b6b




Release Notes:

- Resolved an issue where cancelling an amend commit would incorrectly
leave the old commit message in the input field. The commit message box
now properly reverts to its pre-amend state.
```

## Parents

- [7f607a9b7d93ba07ab1f66330df0b28524bc239c](https://git.cafe/gitcafe/zed/commit/7f607a9b7d93ba07ab1f66330df0b28524bc239c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/8527dcfc652776d3c5d7ade5151c0fdd96801679?format=markdown)
