When you made a mistake and committed a set of incomplete
changes, the git reset command comes handy.
... Edit, compile, and test.
$ git commit -s -m 'The perfect change.'
... Test again, OOPS it fails --- it was not perfect.
$ git reset HEAD^
foo: needs update
bar: needs
So you would naturally be tempted to do this:
... Re-edit, compile, and test. This time it is perfect.
$ git commit -a -C ORIG_HEAD
Well, not really. You can lose any file newly created in
ORIG_HEAD this way. Instead, you need to do this:
... Re-edit, compile, and
2 matches
Mail list logo