Merge pull request #80 from RichardLitt/feature/reset-single-file

Added explanation for reseting a single file
This commit is contained in:
Kate Hudson 2015-09-03 15:56:49 -04:00
commit 5b935d5597
1 changed files with 7 additions and 2 deletions

View File

@ -481,8 +481,7 @@ One way of reseting to match origin (to have the same as what is on the remote)
(master)$ git reset --hard origin/my-branch
```
<a href="discard-local-uncommited-changes"></a>
<a href="i-want-to-discard-my-local-uncommitted-changes"></a>
## 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:
@ -498,6 +497,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
```
<a href="undo-git-reset-hard"></a>
## I accidentally did a hard reset, and I want my changes back