Undoing a git rebase --skip - reapply a commit during a rebase

前端 未结 2 966
一向
一向 2021-02-03 19:22

I\'m doing a long git rebase with a lot of commits. I accidentally --skipped a commit where there were some conflicts which I resolved. I should have d

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-03 20:07

    Git is great because it saves a log of basically everything you commit.

    1. Find your commit in ".git/logs/HEAD" and open in a text editor

    2. Find your SHA in the HEAD file

      3c8c... 2260dc... Full Name {my.email@email.com} 1471276956 -0600 commit: Saving Trial 1,2,3

    3. Type (note type enough of the sha so git knows which one to pull):

      git checkout -b recovery 2260d...

    See link for reference: http://blog.screensteps.com/recovering-from-a-disastrous-git-rebase-mistake

提交回复
热议问题