From eb73619120ef259d4d3607311f0e7fad7bd633ff Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Tue, 18 Aug 2015 16:03:44 -0400 Subject: [PATCH] Added explanation for reseting a single file --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7c56c4..f1cd1bb 100644 --- a/README.md +++ b/README.md @@ -477,8 +477,7 @@ One way of reseting to match origin (to have the same as what is on the remote) (master)$ git reset --hard origin/bug24 ``` - - + ## I want to discard my local, uncommitted changes If you want to only reset to some commit between origin and your local, you can do this: @@ -494,6 +493,12 @@ If you want to only reset to some commit between origin and your local, you can (master)$ git checkout -f ``` +To reset only a specific file, you can use that the filename as the argument: + +```sh +$ git reset filename +``` + ## I accidentally did a hard reset, and I want my changes back