how to remove commit from local branch git code example Example: git delete local commit git reset --hard origin/<branch_name>