Reputation: 83
I have merged a Pull Request with "Merge pull request" option on GitHub instead of using "Squash and merge". I want to revert this merge so that I can do "Squash and merge", the intention behind this step is to make the commit logs cleaner.
Upvotes: 0
Views: 613
Reputation: 670
In your local checkout of the repo,
git reset --hard HEAD~1
This un-does the merge in your local repo, and you can now force push it to github.
Note that you will be modifying published history in this case (it is the only way), and you should be aware of and be ready to accept the implications of it.
Other consequences of `git push --force`?
(In short, if someone had pulled the post-merge state of the repo, you've now alienated them)
Upvotes: 1