Remove pending push in sourcetree

I made files that I do not want to click. I haven't clicked yet, but how to remove a commit.

Here's what it looks like:

enter image description here

These are the options:

enter image description here

I do not want to undo any changes to the source code!

0
git atlassian-sourcetree
source share
1 answer

To remove a 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 for this commit."

Reset current branch to this commit

In the dialog that appears, select "Mixed ..." from the drop-down list and click "OK."

Mixed

Your working copy will remain the same (files will not be changed), but the index will be reset, which means that all commits after the selected one will be deleted from your history.

+3
source share

All Articles