1
0
mirror of https://github.com/k88hudson/git-flight-rules.git synced 2025-06-16 21:01:45 -03:00

fix case: switch stage & unstage files

This commit is contained in:
yaame
2019-09-11 05:01:59 +00:00
parent 5c57fb5ea5
commit 260a140bda
2 changed files with 12 additions and 4 deletions

View File

@ -606,11 +606,15 @@ Then, you will need to use the `e` option to manually choose which lines to add.
<a href="unstaging-edits-and-staging-the-unstaged"></a>
### I want to stage my unstaged edits, and unstage my staged edits
`stash` is a stack. So you can `stash` and `pop/apply --index n`(`apply` will keep it in stack).
In many cases, You should unstage all files and then pick file you want and commit it.
But assume that's what you want,You can create a temp commit to store your stage files, stage your unstaged files and stash them, Then, reset the temp commit and stash pop.
```sh
$ git commit -m "WIP"
$ git add . # also have untracked files
$ git stash
$ git stash pop --index 1
$ git reset HEAD^
$ git stash pop --index 0
```
## Unstaged Edits