git reset does not affect commit, but changes index, stage to them
Clear up what happens when you run `git reset` in that it does not affect the commit, or allow to change it per se, but that it affects what is sitting in the index and staging as pointed to by the commit or HEAD pointer mentioned. Fixes #63
Soon Van committed
May 21, 2013 at 22:06 UTC
96186d05ff119871376ee81f80d9a8ef0e3c0c5a
1 file changed
+7
-5
basic/index.html
+7
-5
@@ -612,7 +612,7 @@ Further paragraphs come after blank lines.
612
613
<h4>
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
</h4>
617
618
<p>First, you can use it to unstage something that has been
@@ -691,7 +691,7 @@ M hello.rb
691
692
<h4>
693
git reset --soft
694
- <small>undo the last commit</small>
694
+ <small>moves what HEAD points to, index and staging are untouched</small>
695
</h4>
696
697
<p>The first thing <code>git reset</code> does is undo the last
@@ -721,11 +721,12 @@ nothing to commit (working directory clean)
721
722
<h4>
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
</h4>
726
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.
730
This is the most dangerous option and not working directory safe. Any
731
changes not in the index or have not been commited will be lost.</p>
732
@@ -752,7 +753,8 @@ nothing to commit (working directory clean)
753
754
<p>In the above example, while we had both changes ready to commit and
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 stage are now reset to the point just after the
757
+ commit pointed at by HEAD.</p>
758
759
<p>You can replace <code>HEAD</code> with a commit SHA-1 or another
760
parent reference to reset to that specific point.</p>