Remove waiting push in SourceTree

34,228

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."

Reset current branch to this commit

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

Mixed

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.

Share:
34,228

Related videos on Youtube

clankill3r
Author by

clankill3r

Updated on July 09, 2022

Comments

  • clankill3r
    clankill3r almost 2 years

    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:

    change list

    These are the options:

    options

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

    • Alexey Andrushkevich
      Alexey Andrushkevich almost 9 years
      I don't want to undo any changes to the source code!! - can you please clarify this moment? If you remove the commit you will definitely undo some changes to the source code. Also it seems there are some uncommitted changes in your local copy. Do you want to save these changes?
    • clankill3r
      clankill3r almost 9 years
      I don't want to push cause I included files that are to large. So I wan't to create a new commit without the large files.