|
612 | 612 |
|
613 | 613 | <h4> |
614 | 614 | git reset HEAD |
615 | | - <small>undo the last commit and unstage the files</small> |
| 615 | + <small>unstage files from index and reset pointer to HEAD</small> |
616 | 616 | </h4> |
617 | 617 |
|
618 | 618 | <p>First, you can use it to unstage something that has been |
|
691 | 691 |
|
692 | 692 | <h4> |
693 | 693 | git reset --soft |
694 | | - <small>undo the last commit</small> |
| 694 | + <small>moves HEAD to specified commit reference, index and staging are untouched</small> |
695 | 695 | </h4> |
696 | 696 |
|
697 | 697 | <p>The first thing <code>git reset</code> does is undo the last |
@@ -721,11 +721,12 @@ <h4> |
721 | 721 |
|
722 | 722 | <h4> |
723 | 723 | git reset --hard |
724 | | - <small>undo the last commit, unstage files AND undo any changes in the working directory</small> |
| 724 | + <small>unstage files AND undo any changes in the working directory since last commit</small> |
725 | 725 | </h4> |
726 | 726 |
|
727 | 727 | <p>The third option is to go <code>--hard</code> and make your working |
728 | | - directory look like the index, unstage files and undo the last commit. |
| 728 | + directory look like the index, unstage files and undo any changes made |
| 729 | + since the last commit. |
729 | 730 | This is the most dangerous option and not working directory safe. Any |
730 | 731 | changes not in the index or have not been commited will be lost.</p> |
731 | 732 |
|
|
752 | 753 |
|
753 | 754 | <p>In the above example, while we had both changes ready to commit and |
754 | 755 | ready to stage, a <code>git reset --hard</code> wiped them out. |
755 | | - On top of that, the last commit has been undone.</p> |
| 756 | + The working tree and staging area are reset to the tip of the current |
| 757 | + branch or HEAD.</p> |
756 | 758 |
|
757 | 759 | <p>You can replace <code>HEAD</code> with a commit SHA-1 or another |
758 | 760 | parent reference to reset to that specific point.</p> |
|
0 commit comments