What does the second command do?
$ git commit -m "Add lgoin page" $ git commit --amend -m "Add login page"
- Reverts the commit and recommits it
- Adds a second commit with the new message
- Edits the message, keeping the same hash
- Replaces the last commit with a new one
--amend builds a new commit (new hash) with the same parent and replaces the branch tip. The old commit is only reachable via the reflog.