Amending the Last Commit
git commit --amend changes the last commit message or adds forgotten files. Do not amend commits you already pushed.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
git commit --amend -qm 'First commit (fixed)'
git log --format=%sResult
First commit (fixed)
Exercise
Change last commit.
git commit -m "new"
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.