Preserve error on checkout original branch fail
Eliminate check_merges from rebuildstaging

It was mostly redundant with rebuild_staging, and rebuild_staging has been enhanced with the missing parts.
Fix undefined variable
Improve output when there are merge conflicts
Merge pull request #4171 from dimagi/remove-redundant-merge-checks

Remove redundant merge checks