Git change last commit message and it's files | The Dev Tool |

Imagine you just made a commit, but realized that the commit message was wrong, or maybe that you added some extra code to a file, or whatever. What would you do? There are several possible ways, but there is one that appears to be the most simple and that's git amend.

git commit --amend -m “new commit message”

This change the last commit message or replace the last commit with a new one with an updated name.

To make some changes to your commit without changing its commit message you can do:

git commit --amend --no-edit

Created by: martin


This page is only partially working without JavaScript. It will show content, but the tools and interactivity cannot be shown without JavaScript enabled. Please enable JavaScript for this page. About Us