git rollback to a certain historical version and force push

1. Use the Git  log command to view all historical versions and obtain the id of a historical version. Suppose that the id of the historical version found is 139dcfaa558e3276b30b6b2e5cbbb9c00bbdca96.

2. 

 

[html]  view plain copy  
 
  1. git reset --hard 139dcfaa558e3276b30b6b2e5cbbb9c00bbdca96  


3. Push the changes to the remote server

 

 

[javascript]  view plain copy  
 
  1. git push -f -u origin master  

 

Guess you like

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