How can I copy the content of a branch to a new local branch?

后端 未结 3 941
后悔当初
后悔当初 2020-12-12 08:56

I have worked on a local branch and also pushed the changes to remote. I want to revert the changes on that branch and do something else on it, but I don\'t want to lose the

3条回答
  •  时光取名叫无心
    2020-12-12 09:22

    git branch copyOfMyBranch MyBranch
    

    This avoids the potentially time-consuming and unnecessary act of checking out a branch. Recall that a checkout modifies the "working tree", which could take a long time if it is large or contains large files (images or videos, for example).

提交回复
热议问题