How to amend a Git commit

preview_player
Показать описание
Need to fix a git commit?
Need to undo a git commit?
Need to remove a git commit?
Need to change a git commit?

Don't waste your time with reset or revert commands. If you want to undo the last commit, or even change the git commit message, just do a git commit amend.

The git commit amend command will allow you to restage files and do a new commit that will replace the previous commit, essentially allowing you to amend your git commit history.

How do you amend a git commit? Just add, delete or modify files as you normally would, and when you're done, use git commit --amend instead of a regular git commit.

The new commit will replace the previous Git commit, allowing you to fix and change your git commit history with the amend.
Рекомендации по теме
Комментарии
Автор

Then this is not a git amend at all...git amend is to make modifications to a commit, it should not change commit ID

sriramnavin