Modifying commits
You can modify the most recent commit in the same branch by running the git commit --amend command. This command is convenient for adding new or updated files to the previous commit. It is also a simple way to edit or add commit messages to the previous commit.
![Use git commit --amend to modify the most recent commit. Diagram using the git ammend command.](/static/60282668f3b1694c6aae8b942f467125/5a190/01.png)