git commit ammend code example
Example 1: amend last commit message
$ git commit --amend -m "New and correct message"
Example 2: git amend last commit message
$ git commit --amend -m "New and correct message"
Example 3: git amend
git commit --amend
Example 4: add change to last commit
$ (some_branch) git commit --amend
Example 5: git ammend commit
# Edit hello.py and main.py
# git add hello.py ---> git commit
# Realize you forgot to add the changes from main.py
# git add main.py
git commit --amend --no-edit