Idea:撤销git已经push的代码(完美解决)

Idea:撤销git已经push的代码(完美解决)

  • 撤回commit:右键git提交的历史记录中要回退的版本,点击”Reset Current Branch to Here…“,然后选择”Hard“,点击”Reset“(如果本地代码不需要回滚的话选soft)

  •  

  • 撤回push:右键git提交的历史记录中要回退的版本,点击”Copy Revsion Number”

  • 选择“Reset HEAD”,Reset Type选择Hard,To Commit位置填入上一步复制的Revsion Number,点击Reset

  • 进入项目所在文件,右键空白位置,选择“Git Batch Here”,执行“git push origin HEAD --force”语句

猜你喜欢

转载自blog.csdn.net/Andrew_Chenwq/article/details/129743116
今日推荐