Git develops the wrong branch, use the temporary storage of git to complete the code transfer to the correct branch

Problem description: I developed a lot of functions on branch one, and found that the wrong branch was developed. The new function should be developed on another branch (branch two), but at this time there is already code developed by other people on the other branch.

Solution:

The first step: first use the "Stash Changes" function in branch one to temporarily store the developed but uncommitted code, and give a name to the temporary code during the temporary storage

Step 2: Switch to branch two, first pull down the code update in the remote warehouse of the branch, and then use "UnStash Changes" to merge the code in the staging area into branch two.

Guess you like

Origin blog.csdn.net/y_bccl27/article/details/114133820
Recommended