git remove the previous 2 commits code example Example: git delete local commit git reset --hard origin/<branch_name>