Ok, I did something stupid.
I have forked a repo on Github. I made some changes, commited them into one commit, pushed that to my fork, and then on Github I created a pull request for the project owner (upstream).
Only, the project owner rightly rejected the commit as it is practically incomprehensible. What I should have done is broken down the diff into 6 different bite-sized commits.
So, I'd like to fix this now. I'd like to revert my last commit. I don't want to lose the changes - just to uncommit them, so that I can pick and choose the changes I want to include in new, smaller commits.
Can Sourcetree help me with that?
This will turn all commits above the reset point into uncommitted changes and you can commit them again as needed. (Afterwards, you will need to force push the results, because you are going to rewrite history.)
Reverse commit creates a commit which has the opposite of the changes of the original one, so that they "cancel out" in the end. It will put the latest state of the repo back to where it was, but you will not have the changes in the working copy to commit again.
If you create a second clone, you can also check out the current head in both, revert the commit in the first, copy over the changed files from the second to the first and then commit the changes in the first, on top of the revert. This spares you the force push in the end, but it is a bit more tedious.
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot