'git checkout' can fail when file is not in index, thus we should fallback to removing the file. Support adding metadata.xml like old sunrise-commit did.