Improve "discard specific unstaged changes" steps
This commit is contained in:
parent
f3428ed7af
commit
542884da13
16
README.md
16
README.md
|
@ -299,21 +299,11 @@ $ git reset filename
|
||||||
|
|
||||||
When you want to get rid of some, but not all changes in your working copy.
|
When you want to get rid of some, but not all changes in your working copy.
|
||||||
|
|
||||||
First strategy, stash all good changes, reset working copy, reapply good changes.
|
Checkout undesired changes, keep good changes.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ git stash -p
|
$ git checkout -p
|
||||||
# Select all of the snippets you want to save
|
# Answer y to all of the snippets you want to drop
|
||||||
$ git reset --hard
|
|
||||||
$ git stash pop
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternate strategy, stash undesired changes, drop stash.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ git stash -p
|
|
||||||
# Select all of the snippets you don't want to save
|
|
||||||
git stash drop
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Branches
|
## Branches
|
||||||
|
|
Loading…
Reference in New Issue