how to merge a branch to the master after git reset hard head branch code example Example: git reset head of master git fetch origin git reset --hard origin/master