Do not touch local branches

This change avoids checking out local branches that do not already exist (except for the target "autostaging" branch of course), and tries to avoid moving the local trunk branch.
Merge pull request #3085 from dimagi/improve-rebuild-script

Do not touch local branches