And buy its Colorado river water.
California as a country would share the river as a mutual border with the US. As national nitty on an international waterway they can claim half the water and it would be subject to international agreement. There is no reason Cal would lose all of the water rights because it became a country.
Now if you want to build another dam and stop the flow of the river and flood the grand canyon then you could keep the water in the US.