[scripts] terminate if git checkout fails