## 1 、 config ~~~ # git 现有的config lists git config --list git config --global user.name "yourName" git config --global user.email "yourEmail@gmai.com" # add git add . # commit git commit -m 'comments' ~~~ ~~~ # stash git stash # 切换到别的分支之前 先执行 git stash 保存到缓存区 git stash list #查看所有 git stash pop # 取出最近的一次 stash git stash apply stash@{X} # 取出想要的stash ~~~ ~~~ # reset git reset --hard 'versionXXX' # 彻底退回到某个版本,本地代码的修改一起没了 git reset --soft 'versionXXX' # 回到某个版本,commit 撤回了,本地代码的修改还在 git reset --hard HEAD^ git reset --soft HEAD^ ~~~