# Amend (rare)

### Amend

One of the common undos takes place when you commit too early and possibly forget to add some files, or you mess up your commit message.&#x20;

If you want to redo that commit, make the additional changes you forgot, stage them, and **commit again** using the `--amend` option:

```
git commit --amend
```

{% hint style="info" %}
Effectively, it’s as if the previous commit never happened, and it won’t show up in your repository history either!
{% endhint %}

{% hint style="danger" %}
We need to use `Esc + : + "wq" (enter)` to exit the message amend screen!
{% endhint %}


---

# 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://raviram.gitbook.io/version-control/basic-operations/undo-changes/amend-rare.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.
