Tiny Wins Home

Git hard reset to origin for current branch

June 07, 2022

If you have force pushed changes to a git branch on the remote and want to pull that branch into your local you can do it in two commands.

git fetch && git reset --hard @{u}

This will fetch the latest changes then reset the current branch with the latest of that same branch from the origin.