Fix branch switching in update command