1.git merge 撤销
首先保证在 merge 时所在分支,如果没在,先切过去:
git checkout branch [merge 所在分支]
使用 git reflog 查看分支记录, 再使用 git reset --hard [commitId],即可撤销本次 merge:
git reflog // 出来一系列操作记录
git reset --hard [commitId] // commitId 为 merge 操作前的版本号,注意不是 merge 操作的版本号哦
当当当,撤销操作完成
网友评论