Git rolls back the specified version and deletes the historical submission records

1. Roll back the local warehouse version

git reset --hard <需要回退到的版本号(可输入前7位,也可以输入完整的版本号)>

Click the icon in the red box to copy the complete version number

insert image description here

Here select the third submission for rollback 

insert image description here

2. Force push to remote warehouse

git push origin <分支名> --force 

insert image description here

 3. View the remote warehouse

The rollback is successful, and the history commit record is gone

insert image description here

Guess you like

Origin blog.csdn.net/qq_27981847/article/details/131109105