How to reset a git branch to another branch without checking out git fetch origin branchA:branchB –force-with-lease git push origin branchB –force-with-lease