If my landlord is taking me to court for unlawful detainer and I am already moved out as of today
1 attorney answer
You can file an amended answer under Code of Civil Procedure Section 472, and indicate on the answer that you have moved out/surrendered possession. See box 4.a of Judicial Council form UD-105.
You should turn in the keys - preferably bringing a witness along, and requesting a receipt (although the landlord/landlord's attorney is not legally required to give you a receipt). Before doing so, make sure to video the condition of the unit (again, it would be best to do so with a witness) to minimize future disputes about that.
Once possession is no longer an issue, the case is supposed to convert from an unlawful detainer to an ordinary civil lawsuit - see Civil Code Section 1952.3.