⇤ ← Revision 1 as of 2010-08-11 22:48:22
Size: 290
Comment:
|
Size: 484
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
Amend the previous commit that has not been propogated (i.e. undo it, then start a new one with the pending changes in the index): {{{ git commit --amend -a -m "New commit message" }}} |
|
Line 7: | Line 13: |
For a commit that has been propagated, there is no way to undo. However, the following will create a new commit undoing the previous commit's changes: | Once a commit that has been propagated, there is no way to undo. However, the following will create a new commit undoing the previous commit's changes: |
Amend the previous commit that has not been propogated (i.e. undo it, then start a new one with the pending changes in the index):
git commit --amend -a -m "New commit message"
Undo a commit that has not been propagated:
git reset --hard HEAD^
Once a commit that has been propagated, there is no way to undo. However, the following will create a new commit undoing the previous commit's changes:
git revert HEAD