revert (reset) before changing branch in git repos