Rolling back in Git

后端 未结 3 1212
忘了有多久
忘了有多久 2021-01-31 03:59

I have committed, and pushed, several patches: A1-->A2-->A3-->A4 (HEAD)

Everyone\'s pulled these changesets into their local copy.

Now we want to \"roll back\" t

3条回答
  •  既然无缘
    2021-01-31 04:56

    Throwing away those commits will likely have some negative effects on anyone who is pulling from your repository. As another option, you may want to consider creating an alternate development branch starting at A2:

    A1-->A2-->A3-->A4 (master/HEAD)
          \
           -->B1-->B2 (new-master/HEAD)
    

    Doing this is as simple as

    git branch new-master master~2
    

提交回复
热议问题