In a lengthier post, Dave M covers similar ground as Andre Santana, using Article 4 Section 3 Clause 2 of the Constitution.
In his take, a small part of California would have to cede the rest of California to the federal government, who, in turn, will create the territory of California and grant the state-owned property back to it.
Another interesting tack he explores is how, through treaties, the President and 2/3 of the Senate can cede land to foreign governments through treaties. This utilizes the fact that the US has broad discretion to recognize foreign governments. In this scenario, the US government recognizes the Republic of California as a foreign government (by treaty), after which they grant the California territory to it (also by treaty.)
And as we all know from civics class, the US Constitution views treaties as the supreme law of the land.