I\'m trying to take a branch with changes and bring it back to be identical to the upstream it diverged from. The changes are both local and have been pushed to github, so n
change to the remote upstream branch and do a git merge with the merge strategy set to ours.
git checkout origin/master
git merge dev --strategy=ours
git commit ...
git push
All the history will still be present, but you'll have an extra merge commit. The important thing here is to start from the version you want to be at and merge ours with the branch github is actually at.