going back to a certain commit

This question already has an answer here:

  • How to revert Git repository to a previous commit? 38 answers
  • Revert multiple git commits 11 answers

  • There are many ways to do this. If I were on master , the way I'd do it is as follows:

  • git branch safety to keep a branch at the old HEAD
  • git reset --hard abc123 to move master back to the old commit, assuming that commit was abc123
  • git branch -D safety to discard the safety branch, if desired
  • 链接地址: http://www.djcxy.com/p/3152.html

    上一篇: 重置Git分支到上次提交? 轨道

    下一篇: 回到某个提交