{"thread":{"id":"13306","subject":"Simple problem","startedAt":"2008-04-28T16:31:05Z","lastAt":"2008-04-28T18:58:51Z","messageCount":5,"participants":["Kenneth P. Turvey","Bill Lear","Björn Steinbrink","Alex Riesen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"75398","messageId":"fv4u49$oks$1@ger.gmane.org","threadId":"13306","inReplyTo":null,"subject":"Simple problem","fromName":"Kenneth P. Turvey","fromEmail":"kt-usenet@squeakydolphin.com","sentAt":"2008-04-28T16:31:05Z","receivedAt":"2008-04-28T16:31:05Z","isPatch":false,"sender":{"key":"kt-usenet@squeakydolphin.com","avatar":null},"body":"I ran into an issue earlier today that I didn't know how to easily solve \nin git.  I'm sure it is easy to handle, but I wasn't sure how.  \n\nI removed a file and then realized I'd hit the wrong one.  So all I \nwanted to do was to get the file back the way it was in the last commit.  \n\nBasically I wanted something similar to:\n\nsvn update myfile\n\nin subversion.  \n\nI got it back by using a diff and just deleting all the minus signs at \nthe beginning of the lines, but I'm sure this isn't the way to handle \nthis.  Strangely this simple case wasn't covered by any of the tutorials \nI looked at. \n\nThanks.\n\n-- \nKenneth P. Turvey <kt-usenet@squeakydolphin.com>\n"},{"id":"75399","messageId":"18453.64747.540905.586259@lisa.zopyra.com","threadId":"13306","inReplyTo":"fv4u49$oks$1@ger.gmane.org","subject":"Re: Simple problem","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2008-04-28T16:35:55Z","receivedAt":"2008-04-28T16:35:55Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Monday, April 28, 2008 at 16:31:05 (+0000) Kenneth P. Turvey writes:\n>I ran into an issue earlier today that I didn't know how to easily solve \n>in git.  I'm sure it is easy to handle, but I wasn't sure how.  \n>\n>I removed a file and then realized I'd hit the wrong one.  So all I \n>wanted to do was to get the file back the way it was in the last commit.  \n>\n>Basically I wanted something similar to:\n>\n>svn update myfile\n>\n>in subversion.  \n>\n>I got it back by using a diff and just deleting all the minus signs at \n>the beginning of the lines, but I'm sure this isn't the way to handle \n>this.  Strangely this simple case wasn't covered by any of the tutorials \n>I looked at. \n\n% rm file\n[oops]\n% git checkout file\n\n\nBill\n"},{"id":"75407","messageId":"20080428164945.GA14445@atjola.homenet","threadId":"13306","inReplyTo":"18453.64747.540905.586259@lisa.zopyra.com","subject":"Re: Simple problem","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-04-28T16:49:45Z","receivedAt":"2008-04-28T16:49:45Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.04.28 11:35:55 -0500, Bill Lear wrote:\n> On Monday, April 28, 2008 at 16:31:05 (+0000) Kenneth P. Turvey writes:\n> >I ran into an issue earlier today that I didn't know how to easily solve \n> >in git.  I'm sure it is easy to handle, but I wasn't sure how.  \n> >\n> >I removed a file and then realized I'd hit the wrong one.  So all I \n> >wanted to do was to get the file back the way it was in the last commit.  \n> >\n> >Basically I wanted something similar to:\n> >\n> >svn update myfile\n> >\n> >in subversion.  \n> >\n> >I got it back by using a diff and just deleting all the minus signs at \n> >the beginning of the lines, but I'm sure this isn't the way to handle \n> >this.  Strangely this simple case wasn't covered by any of the tutorials \n> >I looked at. \n> \n> % rm file\n> [oops]\n> % git checkout file\n\nThat restores the version from the index, so it will fail if you did\n\"git rm file\". To get the file from HEAD use \"git checkout HEAD --\nfile\".\n\nBjörn\n"},{"id":"75413","messageId":"20080428174751.GA6710@steel.home","threadId":"13306","inReplyTo":"fv4u49$oks$1@ger.gmane.org","subject":"Re: Simple problem","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2008-04-28T17:47:51Z","receivedAt":"2008-04-28T17:47:51Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Kenneth P. Turvey, Mon, Apr 28, 2008 18:31:05 +0200:\n> I ran into an issue earlier today that I didn't know how to easily solve \n> in git.  I'm sure it is easy to handle, but I wasn't sure how.  \n> \n> I removed a file and then realized I'd hit the wrong one.  So all I \n> wanted to do was to get the file back the way it was in the last commit.  \n> \n> Basically I wanted something similar to:\n> \n> svn update myfile\n> \n\ngit checkout HEAD filename\n\nbut mostly just \"git checkout filename\"\n"},{"id":"75429","messageId":"fv56pb$ceb$1@ger.gmane.org","threadId":"13306","inReplyTo":"20080428164945.GA14445@atjola.homenet","subject":"Re: Simple problem","fromName":"Kenneth P. Turvey","fromEmail":"kt-usenet@squeakydolphin.com","sentAt":"2008-04-28T18:58:51Z","receivedAt":"2008-04-28T18:58:51Z","isPatch":false,"sender":{"key":"kt-usenet@squeakydolphin.com","avatar":null},"body":"On Mon, 28 Apr 2008 18:49:45 +0200, Björn Steinbrink wrote:\n\n[Snip]\n> That restores the version from the index, so it will fail if you did\n> \"git rm file\". To get the file from HEAD use \"git checkout HEAD --\n> file\".\n\nThanks.  I tested this and it works as advertised.  I took a look at the \nman page and I understand what the -- is for too.  \n\nI had actually tried:\n\ngit checkout myfile.java\n\nand this didn't work.\n\n\n\n-- \nKenneth P. Turvey <kt-usenet@squeakydolphin.com>\n"}]}