My question involves animal law for the State of: California

About 2 months ago we gave away our little terrier to someone who promised to take good care of her. At the time, we felt like it would be a good decision since we were so busy. But until recently, we just found out she had been rescued by a local rescue and they just now contacted us. She was microchipped and still had our phone number on it. The man said that the lady that found her tried to look for the owners and couldn't find them so she gave her up to the rescue. Apparently she had her for 8-9 days but obviously they never scanned the dog because we just now got a phone call about it today.

I called the rescue back and the man there said my dog was in a foster home and he asked me if it was ok for me to let them have her. I didn't have an answer at the time and so I called the foster home and the man there said I can't get my dog back because it is not mine. But what I don't get is that they never scanned the dog to get my number until today!

How can I get my dog back? I regret ever rehoming her and now that we have the time to spend with her, I do want her back. I thought you were supposed to immediately scan a lost dog for this reason, isn't that the point of a microchip?

Also, the foster home said that since the lady that found her had her for so long, technically it became her dog and then she gave it over to the rescue. But I don't think they can do that if they never scanned the dog right away and called us right?

Please help, I miss our little dog.