mirror of
https://github.com/k88hudson/git-flight-rules.git
synced 2025-03-10 12:48:43 -03:00
Discard local uncommitted changes (#156)
This commit is contained in:
parent
02043187a7
commit
7440fa32b5
24
README.md
24
README.md
@ -38,6 +38,8 @@ For clarity's sake all examples in this document use a customized bash prompt in
|
|||||||
- [I want to move my unstaged edits to a different, existing branch](#i-want-to-move-my-unstaged-edits-to-a-different-existing-branch)
|
- [I want to move my unstaged edits to a different, existing branch](#i-want-to-move-my-unstaged-edits-to-a-different-existing-branch)
|
||||||
- [I want to discard my local, uncommitted changes](#i-want-to-discard-my-local-uncommitted-changes)
|
- [I want to discard my local, uncommitted changes](#i-want-to-discard-my-local-uncommitted-changes)
|
||||||
- [I want to discard specific unstaged changes](#i-want-to-discard-specific-unstaged-changes)
|
- [I want to discard specific unstaged changes](#i-want-to-discard-specific-unstaged-changes)
|
||||||
|
- [I want to discard specific unstaged files](#i-want-to-discard-specific-unstaged-files)
|
||||||
|
- [I want to discard all of my local changes](#i-want-to-discard-all-of-my-local-changes)
|
||||||
- [Branches](#branches)
|
- [Branches](#branches)
|
||||||
- [Create a branch from a commit](#create-branch-from-commit)
|
- [Create a branch from a commit](#create-branch-from-commit)
|
||||||
- [I pulled from/into the wrong branch](#i-pulled-frominto-the-wrong-branch)
|
- [I pulled from/into the wrong branch](#i-pulled-frominto-the-wrong-branch)
|
||||||
@ -338,6 +340,28 @@ $ git stash -p
|
|||||||
$ git stash drop
|
$ git stash drop
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### I want to discard specific unstaged files
|
||||||
|
|
||||||
|
When you want to get rid of one specific file in your working copy.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ git checkout myFile
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, to discard multiple files in your working copy, list them all.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ git checkout myFirstFile mySecondFile
|
||||||
|
```
|
||||||
|
|
||||||
|
### I want to discard all of my local changes
|
||||||
|
|
||||||
|
When you want to get rid of all of your local uncommitted changes
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ git checkout .
|
||||||
|
```
|
||||||
|
|
||||||
## Branches
|
## Branches
|
||||||
<a name="create-branch-from-commit"></a>
|
<a name="create-branch-from-commit"></a>
|
||||||
### Create a branch from a commit
|
### Create a branch from a commit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user