git 放弃本地commit,强制使用远程commitgit fetch –allgit reset –hard origin/mastergit 放弃本地暂存文件git reset HEAD .git 放弃本地修改(未暂存)git checkout – .git 放弃未跟踪文件交互模式git clean -igit 删除远程分支git push origin -d branch_namegit 删除本地分支git branch -d branch_namegit 拉取远程分支git checkout -b 本地分支名x origin/远程分支名xgit 版本回退(谨慎使用)git reset –soft commit # 回退到某个 commit 并保留目前的版本到暂存区git reset commit # 回退到某个 commit 并保留目前的版本到工作目录git reset –hard commit # 回退到某个 commit 并丢弃暂存区和工作目录git push -f -u origin master # 将回退的版本强制提交到远程服务器