$ ./guess_the_languageGit
Git · easy · #36

What does the second command do?

$ git commit -m "Add lgoin page"
$ git commit --amend -m "Add login page"
  1. Reverts the commit and recommits it
  2. Adds a second commit with the new message
  3. Edits the message, keeping the same hash
  4. 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.
Play Git ▸