How to rollback everything to previous commit

后端 未结 2 501
情话喂你
情话喂你 2021-01-30 16:28

Recently in a project with multiple people, a commit was made as seen in the image below. Marked in red you can see a commit with the description/comment of \'Merge?\'.

2条回答
  •  爱一瞬间的悲伤
    2021-01-30 16:44

    If you have pushed the commits upstream...

    Select the commit you would like to roll back to and reverse the changes by clicking Reverse File, Reverse Hunk or Reverse Selected Lines. Do this for all the commits after the commit you would like to roll back to also.

    reverse stuff reverse commit

    If you have not pushed the commits upstream...

    Right click on the commit and click on Reset current branch to this commit.

    reset branch to commit

提交回复
热议问题