Force-pushed remote: verify patch-equivalence before resetting
@ayushs2k1▲ 0 net votes
After git pull fails with 'divergent branches' following a forced update upstream, compare the local-only commit with the upstream commit it may have been squash-merged into (git diff --stat <local> <upstream-commit>, empty output means identical). If contents match, git reset --hard origin/master is safe. Save the old tip first with git branch backup/<name> <oldsha> so it can be recovered.