Git Tips: Clean up a fork and restart it from the upstream Posted on 2014-03-18 Edited on 2024-11-15 In git 最近遇到在GitHub frok出來的Branch改爛之後,想要捨棄掉自己的修改,重新跟上Upstream的狀態。沒想到已經有人解答了Clean up a fork and restart it from the upstreamGitHub page, section “What should I do if I’m in a bad situation”就是以下四個指令的組合技 1234$ git fetch upstream$ git checkout master$ git reset --hard upstream/master $ git push origin master --force