{"thread":{"id":"17609","subject":"Question about removing changes from the index","startedAt":"2009-02-06T13:57:35Z","lastAt":"2009-02-06T14:51:23Z","messageCount":5,"participants":["Gustav Hållberg","Björn Steinbrink","Sitaram Chamarty","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"103477","messageId":"a1e915350902060557m5a67eba0q819c2ba2a0a49c21@mail.gmail.com","threadId":"17609","inReplyTo":null,"subject":"Question about removing changes from the index","fromName":"Gustav Hållberg","fromEmail":"gustav@gmail.com","sentAt":"2009-02-06T13:57:35Z","receivedAt":"2009-02-06T13:57:35Z","isPatch":false,"sender":{"key":"gustav@gmail.com","avatar":null},"body":"I'm wondering if there's anyone who can recommend a smart way to\n\"reset\" the index entry for individual files to the contents of HEAD,\nin effect, removing any previous change between HEAD and the index\n(for those files).\n\nI'm aware that 'git gui' lets you do this (in a human-friendly way)\nbut I want to do this from a script (and am not concerned about the\nhuman-friendliness, as long as it's not too programmer-unfriendly).\n\nThanks,\nGustav\n"},{"id":"103481","messageId":"20090206140911.GC31491@atjola.homenet","threadId":"17609","inReplyTo":"a1e915350902060557m5a67eba0q819c2ba2a0a49c21@mail.gmail.com","subject":"Re: Question about removing changes from the index","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2009-02-06T14:09:11Z","receivedAt":"2009-02-06T14:09:11Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2009.02.06 14:57:35 +0100, Gustav Hållberg wrote:\n> I'm wondering if there's anyone who can recommend a smart way to\n> \"reset\" the index entry for individual files to the contents of HEAD,\n> in effect, removing any previous change between HEAD and the index\n> (for those files).\n\nBelieve it or not, it's \"git reset\" ;-)\n\ngit reset -- file\n\nYou can only reset the index entry for that file to some older version,\ne.g. \"git reset HEAD~5 -- file\".\n\nBjörn\n"},{"id":"103484","messageId":"vpqprhvbqpk.fsf@bauges.imag.fr","threadId":"17609","inReplyTo":"a1e915350902060557m5a67eba0q819c2ba2a0a49c21@mail.gmail.com","subject":"Re: Question about removing changes from the index","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-02-06T14:11:19Z","receivedAt":"2009-02-06T14:11:19Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Gustav Hållberg <gustav@gmail.com> writes:\n\n> I'm wondering if there's anyone who can recommend a smart way to\n> \"reset\" the index entry for individual files to the contents of HEAD,\n> in effect, removing any previous change between HEAD and the index\n> (for those files).\n\nIsn't \"git reset -- path\" what you want? Or perhaps \"git checkout HEAD\n-- path\" if you also want to reset the file content.\n\n-- \nMatthieu\n"},{"id":"103483","messageId":"slrngoohdp.rak.sitaramc@sitaramc.homelinux.net","threadId":"17609","inReplyTo":"a1e915350902060557m5a67eba0q819c2ba2a0a49c21@mail.gmail.com","subject":"Re: Question about removing changes from the index","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-02-06T14:14:17Z","receivedAt":"2009-02-06T14:14:17Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2009-02-06, Gustav Hållberg <gustav@gmail.com> wrote:\n> I'm wondering if there's anyone who can recommend a smart way to\n> \"reset\" the index entry for individual files to the contents of HEAD,\n> in effect, removing any previous change between HEAD and the index\n> (for those files).\n\nerr.. 'git reset HEAD -- file'?  The man page says \"The\nsecond form with paths is used to revert selected paths in\nthe index from a given commit, without moving HEAD.\"\n"},{"id":"103493","messageId":"a1e915350902060651r142e8d87gd013376a866e5158@mail.gmail.com","threadId":"17609","inReplyTo":"20090206140911.GC31491@atjola.homenet","subject":"Re: Question about removing changes from the index","fromName":"Gustav Hållberg","fromEmail":"gustav@gmail.com","sentAt":"2009-02-06T14:51:23Z","receivedAt":"2009-02-06T14:51:23Z","isPatch":false,"sender":{"key":"gustav@gmail.com","avatar":null},"body":"Thanks everyone; I feel appropriately silly now :-)\n\n- Gustav\n"}]}