Remove waiting push in SourceTree

坚强是说给别人听的谎言 提交于 2019-12-23 07:56:02

问题


I committed files that I don't want to push. I didn't push yet.

How can I remove the commit?

This is how my screen looks:

These are the options:

I don't want to undo any changes to the source code!


回答1:


To remove the commit without changing any source code, you need to perform a "mixed" reset.

Right click on the last "good" commit (this will probably be origin/master). Select "Reset current branch to this commit."

In the resulting dialog, select "Mixed..." from the drop down and click OK.

Your working copy will remain the same (no files will be changed) but the index will be reset, meaning that all commits after the selected one will be removed from your history.



来源:https://stackoverflow.com/questions/30423775/remove-waiting-push-in-sourcetree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!