How do I revert master branch to a tag in git?

前端 未结 2 1698
-上瘾入骨i
-上瘾入骨i 2020-12-12 09:53

We have branches origin and develop. The initial state of master was tagged at tag_ABC.

We have few changes made to the develop branch and pushed to or

2条回答
  •  醉话见心
    2020-12-12 10:28

    You can do

    git checkout master
    git reset --hard tag_ABC
    git push --force origin master
    

    Please note that this will overwrite existing history in the upstream repo and may cause problems for other developers who have this repo checked out.

提交回复
热议问题