Open HeyShinner opened 4 years ago
git stash help
usage: git stash list [<options>]
or: git stash show [<stash>]
or: git stash drop [-q|--quiet] [<stash>]
or: git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]
or: git stash branch <branchname> [<stash>]
or: git stash save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
[-u|--include-untracked] [-a|--all] [<message>]
or: git stash [push [--patch] [-k|--[no-]keep-index] [-q|--quiet]
[-u|--include-untracked] [-a|--all] [-m <message>]
[-- <pathspec>...]]
or: git stash clear
git stash -u
包含 untracked files
git log --graph --all --decorate --oneline
查看 stash 记录的 commit id- dd7b26b (master) Extract method
- b0d0487 Rename one of the assertScreenForEvent methods
- ddbb532 Use strong typing for Events
| *-. **0374bd1** (refs/stash) WIP on master: d7fe9ab new class Event
| |\ \
| | | * 2a958c1 untracked files on master: d7fe9ab new class Event
| | * 51510de index on master: d7fe9ab new class Event
| |/
| * d7fe9ab (HEAD) new class Event
| * c59f0f3 Extract method
| * 74a987f Rename one of the assertScreenForEvent methods
| * 75e98b7 Use strong typing for Events
|/
| * 40b5b29 (origin/master, origin/HEAD) added language-chooser
0374bd1
就是出问题的 commit
git checkout 0374bd1
git reset --soft HEAD~1
git stash -u
git checkout <branch_name>
git stash pop
有惊无险,寻回代码 (゚▽゚)/
git stash -u
之后的事故处理