git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Help reverting a particular file
@ 2008-08-11 23:00 Bryan Richardson
  2008-08-11 23:33 ` Eric Raible
  0 siblings, 1 reply; 3+ messages in thread
From: Bryan Richardson @ 2008-08-11 23:00 UTC (permalink / raw)
  To: git

Hello all,

Can anyone tell me how to revert a particular file using git?  I
executed a commit, then froze my Rails application to the latest Rails
version.  This caused my custom config/boot.rb file to be overwritten
and I would like to restore it without rolling back to the previous
commit (which would roll back the rails freeze).  In general I need to
know how to do this anyway. :)

Please help!

--
Thanks!
Bryan

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

* Re: Help reverting a particular file
  2008-08-11 23:00 Help reverting a particular file Bryan Richardson
@ 2008-08-11 23:33 ` Eric Raible
  2008-08-12  6:15   ` Alex Riesen
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Raible @ 2008-08-11 23:33 UTC (permalink / raw)
  To: git

Bryan Richardson <btricha <at> gmail.com> writes:

> 
> Hello all,
> 
> Can anyone tell me how to revert a particular file using git?  I
> executed a commit, then froze my Rails application to the latest Rails
> version.  This caused my custom config/boot.rb file to be overwritten
> and I would like to restore it without rolling back to the previous
> commit (which would roll back the rails freeze).  In general I need to
> know how to do this anyway. :)
> 
> Please help!
> 
> --
> Thanks!
> Bryan
> 

See corresponding man page for full details, but briefly:

# Updates index as well
git checkout HEAD^ -- config/boot.rb

or

# Output can be redirected
git show HEAD^:config/boot.rb

- Eric

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

* Re: Help reverting a particular file
  2008-08-11 23:33 ` Eric Raible
@ 2008-08-12  6:15   ` Alex Riesen
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Riesen @ 2008-08-12  6:15 UTC (permalink / raw)
  To: Eric Raible; +Cc: git

Eric Raible, Tue, Aug 12, 2008 01:33:17 +0200:
> Bryan Richardson <btricha <at> gmail.com> writes:
> > 
> > Can anyone tell me how to revert a particular file using git?  I
> > executed a commit, then froze my Rails application to the latest Rails
> > version.  This caused my custom config/boot.rb file to be overwritten
> > and I would like to restore it without rolling back to the previous
> > commit (which would roll back the rails freeze).  In general I need to
> > know how to do this anyway. :)
> > 
> 
> See corresponding man page for full details, but briefly:
> 
> # Updates index as well
> git checkout HEAD^ -- config/boot.rb
> 

That'd revert it to the _previous_ commit, not the current, while he
seems to need the recently committed state in his working tree:

  git checkout HEAD -- config/boot.rb

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

end of thread, other threads:[~2008-08-12  6:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-11 23:00 Help reverting a particular file Bryan Richardson
2008-08-11 23:33 ` Eric Raible
2008-08-12  6:15   ` Alex Riesen

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