git checkout commit_id 切换到对应的commit
[root@devops itrafficfront]# git checkout e72378370354786e954bb1bd752dc2c1f566f512 note: checking out 'e72378370354786e954bb1bd752dc2c1f566f512'. you are in 'detached head' state. you can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. if you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. example: git checkout -b new_branch_name head 目前位于 e723783... 修改解析状态错误bug //基于此commit创建hainan分支并切换到hainan分支 [root@devops itrafficfront]# git checkout -b hainan 切换到一个新分支 'hainan' [root@devops itrafficfront]# git branch develop * hainan //推送到远程 [root@devops itrafficfront]# git push -u origin hainan