Better Call Glew: Get Out of My Yard Or I'll Call The Cops!
To be found guilty of violating Penal Code Section 602, trespassing, you must willfully enter someone else's property without the consent of the owner and occupy the land without the owner's consent. Applying this to what you have told me, technically, you were trespassing.
Is it a righteous trespassing case? No, but it is a technical one nonetheless. When the property owner told you to leave his property the way you came in, you should have turned right around. Instead, by ignoring this request, you now willfully entered and continuously occupied the property of another without the property owner's consent. That is to say, once you ignored the property owner's request, you trespassed through the property as it was made abundantly clear that you did not have consent to be there, and you remained there nonetheless.
Had you simply turned around, we would not be having this conversation. I know it may not seem like the crime of the century, but it is still a technical trespass. However, I would encourage you to obtain a lawyer for this case for sure. This is definitely a case that should be negotiated for a fine and a dismissal at worst. If you have no prior record and no damage was done it is highly likely the district attorney would be willing to work with you on this one. If you do end up pleading to the trespass charge then make sure you petition the court after termination of probation to expunge your record under California Penal Code 1203.4.
Next time, stick to public sidewalks, and if you do find yourself on someone else's property and they ask you to leave, just leave; it's not worth the headache and legal woes!