Git development
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Bill Lear <rael@zopyra.com>
Cc: "Kenneth P. Turvey" <kt-usenet@squeakydolphin.com>, git@vger.kernel.org
Subject: Re: Simple problem
Date: Mon, 28 Apr 2008 18:49:45 +0200	[thread overview]
Message-ID: <20080428164945.GA14445@atjola.homenet> (raw)
In-Reply-To: <18453.64747.540905.586259@lisa.zopyra.com>

On 2008.04.28 11:35:55 -0500, Bill Lear wrote:
> On Monday, April 28, 2008 at 16:31:05 (+0000) Kenneth P. Turvey writes:
> >I ran into an issue earlier today that I didn't know how to easily solve 
> >in git.  I'm sure it is easy to handle, but I wasn't sure how.  
> >
> >I removed a file and then realized I'd hit the wrong one.  So all I 
> >wanted to do was to get the file back the way it was in the last commit.  
> >
> >Basically I wanted something similar to:
> >
> >svn update myfile
> >
> >in subversion.  
> >
> >I got it back by using a diff and just deleting all the minus signs at 
> >the beginning of the lines, but I'm sure this isn't the way to handle 
> >this.  Strangely this simple case wasn't covered by any of the tutorials 
> >I looked at. 
> 
> % rm file
> [oops]
> % git checkout file

That restores the version from the index, so it will fail if you did
"git rm file". To get the file from HEAD use "git checkout HEAD --
file".

Björn

  reply	other threads:[~2008-04-28 16:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28 16:31 Simple problem Kenneth P. Turvey
2008-04-28 16:35 ` Bill Lear
2008-04-28 16:49   ` Björn Steinbrink [this message]
2008-04-28 18:58     ` Kenneth P. Turvey
2008-04-28 17:47 ` Alex Riesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080428164945.GA14445@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=kt-usenet@squeakydolphin.com \
    --cc=rael@zopyra.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox