For initial diarrhea, cut out raisins and feed extra plain mini wheat squares--pellets and hay as usual. Also Kaopectate can be used (consult your vet for dosage)the strawberry flavor seems to be most palatible to the chins--NEVER, NEVER use Pepto-Bismal!!!
If diarrhea lasts for more than 3 days, you need to get the chinchilla to a vet. Most likely, it has giardia-- that will require an antibiotic. Be aware that this is HIGHLY contagious, so quarantine the animal and use rubber gloves and wash hands thoroughly. Once the chin is better, the cage should be sterilized.
After any antibiotic, a course of yogurt (one with live, active cultures) is in order to replace the healthy bacteria in the intestinal tract that the antibiotic destroys.