GitHub - How to revert changes to previous state

后端 未结 4 420
感情败类
感情败类 2021-01-30 08:43

I am using GitHub as my remote repository.

I have already pushed 5 commits to the server and want to revert back to the state before the those commits.

If the co

4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 09:39

    You can do git revert to all the commits that have been made after your required state. (In the reverse order to avoid any conflicts.)

    This is a clean way if there are other people sharing the repo, but a little effortsome. (You may automate though...?)

提交回复
热议问题