Is there any way to undo the effects of “git revert head”?

前端 未结 4 1539
萌比男神i
萌比男神i 2020-12-02 16:17

I\'ve accidentally run the command against the wrong branch in my repository - is there a way to undo this change?

4条回答
  •  感情败类
    2020-12-02 17:10

    If you were prescient enough to have done this: revert --no-commit master, you can abort that with: git revert --abort per the git status advice:

    $ git status
    On branch master
    Your branch is up-to-date with 'origin/master'.
    You are currently reverting commit dcc7c46.
      (all conflicts fixed: run "git revert --continue")
      (use "git revert --abort" to cancel the revert operation)
    

提交回复
热议问题