git rest --hard

git push 时如果发现带有以前的 commit,且 git pull 和 rebase 都尝试过也无效

可以使用 git reset --hard origin/master 来定位到最新的 commit,并重新提交变动的代码

git reset --hard origin/master

  

 

posted @ 2025-01-02 17:27  strive-sun  阅读(7)  评论(0)    收藏  举报