Open main menu

Changes

79 bytes added ,  20:09, 3 December 2015
adds simple pointer on removing contents from previous commit
You forgot to add a file to the last commit? Just add it to the index, and commit with <code>--amend</code>. Added a file that shouldn't be there? <code>git rm</code> it. If you leave off the -m (message) option in the new commit, it will let you re-use the last commit message. This lets you "undo the last commit" and redo it right. You usually do not want to amend a commit if you've already pushed it to other repos, but if it's just local <code>--amend</code> is awesome-sauce.
<source lang="bash">
git add forgotten.php
git rm oops.txt
git commit --amend
git log --stat
4,558

edits