git merge导致远端代码混乱解决办法-撤销merge

1. 确认当前状态
查看提交历史:git log --oneline --graph(q 退出)
确认错误合并点:找到错误的 merge commit hash
检查远端状态:git remote show origin

2. 撤销合并提交

# 撤销合并提交,保留更改
git revert -m 1 <merge_commit_hash>

# 提交差异代码

git commit 

# 推送到远端
git push origin <branch_name>

posted @ 2025-12-24 11:36  🍒lychee.wang  阅读(6)  评论(0)    收藏  举报