About amending a commit
Amending a commit is a way to modify the most recent commit you have made in your current branch. This can be helpful if you need to edit the commit message or if you forgot to include changes in the commit. When you amend a commit, you replace the previous commit with a new commit to your current branch.
If possible, you should only amend a commit that you haven't pushed to the remote repository. To amend a commit that has been pushed to the remote repository, you will need to use a force push to overwrite the commit history in the remote repository. Overwriting commit history may cause confusion for other collaborators working with the repository, because they may have already based work on the commit you have amended.
Amending a commit
-
In the left sidebar, click History.
-
Right-click on the most recent commit and select Amend commit.
-
In the "Amend Will Require Force Push" dialog window, click Begin Amend.
-
In the "Changes" tab, use the Summary field to modify the commit message. Optionally, you can modify or add information about the commit in the Description field.
-
Select any uncommitted changes that you would like to add to the commit. For more information about selecting changes, see "Committing and reviewing changes to your project in GitHub Desktop."
-
Once you have finalized your changes, click Amend last commit.