Fix install script

Merge must be done after checkout.
We remove stash pop, since current changes may not be suitable for the selected branch.