1.Git 版本回滚
git reset --hard HEAD^^ ----- 回滚到上一个版本 等同于 git reset --hard "HEAD^"
git reset --hard HEAD~n ---- 回滚到前几个版本,n 为正整数 1,2,3 ...
git reset --hard commit_id ----- 回滚到指定版本 commit_id 指的是提交的版本id,commit_id 可以通过 git log 命令查询提交历史。
git push origin master ----- 推送代码到远程分支 master
2.创建分支、删除分支
git branch branchName ------ 创建分支,branchName 分支名称
git checkout branchName ------ 切换分支
git push origin branchName ------ 推送分支到远程仓库
git branch -d branchName ------ 删除本地仓库 , branchName 仓库名称
git push origin --delete branchName ------- 删除远程仓库 ,branchName 仓库名称