When I merged https://github.com/nodemcu/nodemcu-firmware/pull/1627 a few days ago, a snap from the dev
branch to the master
branch, I chose "squash and merge" instead of a regular "merge commit". I can't simply revert the PR and create a new PR from dev
as there have been commits to dev
in the meantime.
Is there a sensible way to fix this? Maybe something like https://stackoverflow.com/a/28497372/131929?
Although I fully agree with @torek's answer, he left out some of the details. You can indeed revert the commit on the master
branch. There are two ways of doing this:
git reset HEAD~1
. This only works if you didn't commit anything else to the master
branch in the meantime and you'll have to push using git push -f
. Using this command will remove the commit from the history.git revert REV
, where REV
is the hash of the commit. In this case an extra commit will be created which undoes the exact work of the commit.Then the easiest way to have just this work in a new pull request would be to first check out the exact work you had: git checkout REV
. Then you can create a new branch (git checkout -b NAME
), push this branch and create a new pull request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With