git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* abouy git reset command
@ 2008-05-13  7:07 amishera
  2008-05-13  8:33 ` Jakub Narebski
  2008-05-13 12:34 ` David Tweed
  0 siblings, 2 replies; 3+ messages in thread
From: amishera @ 2008-05-13  7:07 UTC (permalink / raw)
  To: git


Hi,
I just want to make sure whether my understanding of that command is correct
or not. I have 3 basic requirements:

1. I have changed something after the commits and I think those are wrong.
So I want to undo all changes and the working directory should reflect last
commit:

git reset --hard HEAD

2. I have some changes in the index and I want undo them.

git reset HEAD

3. I just want to undo the last commit but not the working tree:

git reset HEAD^

If they are correct commands please let me know. 

Besides in the man page for git reset it is mentioned:

git-reset - Reset current HEAD to the specified state

Which means it is supposed to work with commits. But why is the same command
work in case 2 and case 3 above? 

Moreover, can any body tell me the use of

git reset --soft

The following language is confusing:

--soft

    Does not touch the index file nor the working tree at all, but requires
them to be in a good order.

Thanks in advance.
-- 
View this message in context: http://www.nabble.com/abouy-git-reset-command-tp17202423p17202423.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-13 12:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-13  7:07 abouy git reset command amishera
2008-05-13  8:33 ` Jakub Narebski
2008-05-13 12:34 ` David Tweed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).