From 2518489e09a10ed64bddd3a56a5a1646b795749e Mon Sep 17 00:00:00 2001 From: Soon Van Date: Tue, 21 May 2013 22:06:56 -0400 Subject: [PATCH 1/2] 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 --- basic/index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/basic/index.html b/basic/index.html index 9a2f3d3..b760752 100644 --- a/basic/index.html +++ b/basic/index.html @@ -612,7 +612,7 @@

git reset HEAD - undo the last commit and unstage the files + unstage files from index and reset pointer to HEAD

First, you can use it to unstage something that has been @@ -691,7 +691,7 @@

git reset --soft - undo the last commit + moves what HEAD points to, index and staging are untouched

The first thing git reset does is undo the last @@ -721,11 +721,12 @@

git reset --hard - undo the last commit, unstage files AND undo any changes in the working directory + unstage files AND undo any changes in the working directory since last commit

The third option is to go --hard and make your working - directory look like the index, unstage files and undo the last commit. + directory look like the index, unstage files and undo any changes made + since the last commit. This is the most dangerous option and not working directory safe. Any changes not in the index or have not been commited will be lost.

@@ -752,7 +753,8 @@

In the above example, while we had both changes ready to commit and ready to stage, a git reset --hard wiped them out. - On top of that, the last commit has been undone.

+ The working tree and stage are now reset to the point just after the + commit pointed at by HEAD.

You can replace HEAD with a commit SHA-1 or another parent reference to reset to that specific point.

From c60a95ab38c636cad12e6640ee596c519766b86b Mon Sep 17 00:00:00 2001 From: Soon Van Date: Wed, 22 May 2013 13:56:20 -0400 Subject: [PATCH 2/2] Clarify where git reset moves HEAD, affect on stage, index --- basic/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/basic/index.html b/basic/index.html index b760752..23455c8 100644 --- a/basic/index.html +++ b/basic/index.html @@ -691,7 +691,7 @@

git reset --soft - moves what HEAD points to, index and staging are untouched + moves HEAD to specified commit reference, index and staging are untouched

The first thing git reset does is undo the last @@ -753,8 +753,8 @@

In the above example, while we had both changes ready to commit and ready to stage, a git reset --hard wiped them out. - The working tree and stage are now reset to the point just after the - commit pointed at by HEAD.

+ The working tree and staging area are reset to the tip of the current + branch or HEAD.

You can replace HEAD with a commit SHA-1 or another parent reference to reset to that specific point.