git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* reverting a file or files back to repository copy
@ 2009-05-02 14:54 Aaron Gray
  2009-05-02 15:25 ` Peter Harris
  0 siblings, 1 reply; 3+ messages in thread
From: Aaron Gray @ 2009-05-02 14:54 UTC (permalink / raw)
  To: Git Mailing List

How do I do the eqivalent of an 'svn revert' on a single file, on a 
directory of files, or on all files ?

I found 'git reset --hard HEAD' but it seems like a hammer to crack open a 
nut.

Many thanks in advance,

Aaron

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

* Re: reverting a file or files back to repository copy
  2009-05-02 14:54 reverting a file or files back to repository copy Aaron Gray
@ 2009-05-02 15:25 ` Peter Harris
  2009-05-02 15:33   ` Markus Heidelberg
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Harris @ 2009-05-02 15:25 UTC (permalink / raw)
  To: Aaron Gray; +Cc: Git Mailing List

On Sat, May 2, 2009 at 10:54 AM, Aaron Gray wrote:
> How do I do the eqivalent of an 'svn revert' on a single file, on a
> directory of files, or on all files ?

git checkout <files>

Peter Harris

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

* Re: reverting a file or files back to repository copy
  2009-05-02 15:25 ` Peter Harris
@ 2009-05-02 15:33   ` Markus Heidelberg
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Heidelberg @ 2009-05-02 15:33 UTC (permalink / raw)
  To: Peter Harris; +Cc: Aaron Gray, Git Mailing List

Peter Harris, 02.05.2009:
> On Sat, May 2, 2009 at 10:54 AM, Aaron Gray wrote:
> > How do I do the eqivalent of an 'svn revert' on a single file, on a
> > directory of files, or on all files ?
> 
> git checkout <files>

This will use the state of the files from the index.
To revert to the latest commit, i.e. discard all your local changes of
particular files, use

    git checkout HEAD -- <files>

Markus

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

end of thread, other threads:[~2009-05-02 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-02 14:54 reverting a file or files back to repository copy Aaron Gray
2009-05-02 15:25 ` Peter Harris
2009-05-02 15:33   ` Markus Heidelberg

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).