Skip to content

Commit

Permalink
Improve "discard specific unstaged changes" steps
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDaveHello authored Apr 9, 2017
1 parent f3428ed commit 542884d
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,21 +299,11 @@ $ git reset filename

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
$ git stash -p
# Select all of the snippets you want to save
$ 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
$ git checkout -p
# Answer y to all of the snippets you want to drop
```

## Branches
Expand Down

0 comments on commit 542884d

Please sign in to comment.