git checkout -b feature_x切换回主分支:git checkout master再把新建的分支删掉:git branch -d feature_x除非你将分支推送到远端仓库,不然该分支就是 不为他人所见的:git push origin <branch>git pull要合并其他分支到你的当前分支(例如 master),执行:git merge <branch>git reset --hard HEAD^回退到某一个版本 :git reset --hard commit_id例如: git reset --hard 3628164穿梭前,用git log可以查看提交历史,以便确定要回退到哪个版本。要重返未来,用git reflog查看命令历史,以便确定要回到未来的哪个版本。修改前 [remote "origin"] url = https://github.com/xxx/xxx fetch = +refs/heads/*:refs/remotes/origin/* 修改后 [remote "origin"] url = git@github.com:xxx/xxx fetch = +refs/heads/*:refs/remotes/origin/* 新闻热点
疑难解答