使用IDEA回滚某次提交的代码步骤,和回滚某次已经commit的代码但是没有push的代码

发布时间 2023-06-21 11:26:39作者: BBS_自律

使用IDEA回滚某次提交的代码步骤

1.已经push的代码回滚

  选中提交的版本:右击Revert Commit

会新增一个 Revert “xxx Commit”的Commit记录,并将"xxx Commit"中的代码全部回滚。

  如果是已经push到远端的Commit,Revert Commit后还需要进行push。

 

2.已经commit 但是没有push的代码

选中你commit的上一个节点。然后使用 Reset Current Branch to Here