Git falls back to an older version

1. Use SourceTree to find the time point of submission, for example, I want to go back to the time point in the figure below

2. Extract the commit id marked above and use the git console command

$ git checkout 6c682bec1e760583d83d7aa2e390678a68b2bdcd 

In this way, the local code will fall back to the modified version

3. Then find the function you need and extract the code

4. Finally go back to the current master version and add the missing code

$ git checkout master
must submit the modified code first during the checkout process, otherwise an error will be reported and the rollback will be unsuccessful.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325436784&siteId=291194637