Git · Everyday workflow

git commit --amend

Replaces the last commit, for example to fix the message. Do not amend commits that others have pulled.

Syntax
git commit --amend

Example

Example
git add forgotten-file.ts
git commit --amend --no-edit

More in this group

git add git blame git commit git diff git fetch git log git mv git pull

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course