git status <-- review/list uncommitted changesgit stash <-- stash uncommitted changesgit stash branch <new-branch> stash@{1} <-- create a branch from stashgit add . <-- add local changesgit status <-- review the status; ready to commitgit commit -m "local changes ..." <-- commit the changesgit branch --list <-- see list of branches incl the one created abovegit status <-- nothing to commit, working tree (new-branch) is cleangit checkout <old-branch> <-- switch back
!如果repo有多个存储,请查看将哪一个应用于new-分支:
git stash liststash@{0}: WIP on ...stash@{1}: WIP on ...