1. 程式人生 > 實用技巧 >git遠端master回滾

git遠端master回滾

git遠端master回滾

  1. 顯示提交的log

    git log

  2. 回滾到指定的版本
    方法一:
    git reset --hard e377f6,…
    方法二:
    version control 視窗-log-篩選查詢指定的log-reset current branch to here
    在這裡插入圖片描述

  3. 強制提交

    git push --force

  4. git報錯,需要進入gitlab專案設定,protected branches裡取消master的protected,點選unprotected

在這裡插入圖片描述