Make sure to close all text editors or any programs accessing the files in the repo prior to running these commands.
git checkout master
git pull
git branch -f hotfix master
git checkout hotfix
git push origin +hotfix
The plus sign forces the remote branch to accept your rewritten history, otherwise you will end up with divergent branches NOTE: This will remove all commits in the hotfix branch that were used in a pull squash request
Make sure to close all text editors or any programs accessing the files in the repo prior to running these commands.
git checkout master
git pull
git branch -f feature master
git checkout feature
git push origin +feature
The plus sign forces the remote branch to accept your rewritten history, otherwise you will end up with divergent branches NOTE: This will remove all commits in the hotfix branch that were used in a pull squash request
For Easy Copy Paste to reset both branches
git checkout master
git pull
git branch -f hotfix master
git checkout hotfix
git push origin +hotfix
git checkout master
git pull
git branch -f feature master
git checkout feature
git push origin +feature