diff --git a/book/02-git-basics/sections/undoing.asc b/book/02-git-basics/sections/undoing.asc index fb4450510..0c0dbfb9e 100644 --- a/book/02-git-basics/sections/undoing.asc +++ b/book/02-git-basics/sections/undoing.asc @@ -31,6 +31,14 @@ $ git commit --amend You end up with a single commit – the second commit replaces the results of the first. +[NOTE] +==== +It's important to understand that when you're amending your last commit, you're not so much fixing it as _replacing_ it entirely with a new, improved commit that pushes the old commit out of the way and puts the new commit in its place. +Effectively, it's as if the previous commit never happened, and it won't show up in your repository history. + +The obvious value to amending commits is to make minor improvements to your last commit, without cluttering your repository history with commit messages of the form, ``Oops, forgot to add a file'' or ``"Darn, fixing a typo in last commit''. +==== + [[_unstaging]] ==== Unstaging a Staged File