如果你的意思是 的 完全 强> 丢弃这两个提交( 的 警告:您将完全丢失该代码! 强> ), 您可以使用 git reset --hard 在那个提交上。
git reset --hard
右键单击要保留的最后一次提交(对于您的图片,提交3), Reset Current Branch to Here... - > Hard 。
Reset Current Branch to Here...
Hard