git回撤

1. git log找到需要回撤的commit_hash

2. 执行git reset --soft commit_hash (这样的话,不会删除最新的代码。如果完全回退到以前版本,可以使用--hard替换--soft)

3. 修改代码,或者删除代码

4.git add -A; git commit -m "resubmit"; git push --force

 

 
posted @ 2022-05-26 15:39  Shiyu_Huang  阅读(85)  评论(0编辑  收藏  举报