Git fundamentals
Theory: Changing the last commit
It is very common for developers to commit and immediately realize that they forgot to add some files using git add. The rest of the changes can be sent with the next commit, or, if the changes have not yet been sent to an external system, you can add the changes to the current commit. To do this, add the --amend flag while committing:
In reality --amend does not add changes to an existing commit, this flag causes a commit to be rolled back (via reset) and a new commit with new data to be executed. This is why we see exactly one commit, even though the git commit command was run twice (first one was a commit we then fix).
The --no-edit option can be added to the git commit --amend command to avoid opening an editor to enter a commit description. In this case, the commit description will not change.

