git checkout&branch Go back to a certain version for modification

1. Prepare data, submit one row at a timeInsert picture description here

2. The cashback version 2 has bugs that need to be modified
Insert picture description here
Insert picture description here

3. Fix the bug and submit it.
Insert picture description here
Insert picture description here
At this point, if you accidentally switch to another branch (for example, checkout master) git reflog, you can use it , find the deteched commit, and checkoutpass it for reference .

4. Create a new branch, to preserve the submission (not recommended git reflogtoo much trouble)
1) creating a branch in the detached point
Insert picture description here

Insert picture description here
At this point, the fixbug has been saved, and this version can be released at this time

5. Merge the fixbug version with our newly developed version
1)
Insert picture description here
switch back to the master branch 2) master merge fixbug
Insert picture description here
2) handle conflicts
Insert picture description here
3) handle the results.
Insert picture description here
At this time, the new version can be released, and the new version also includes the version that fixes the bug.

Guess you like

Origin blog.csdn.net/claroja/article/details/114955378