You could either choose a detergent or a vinegar mix to clean the bleach out of the carpet.
Bleach the carpet.
As soon as you notice the bleach stain immediately blot it with water and paper towel.
Chlorine can damage synthetic yarns cotton fibers wool threads and silk filaments however.
Washing rugs in standard issue chlorine bleach is the time honored traditional way to remove stains discolorations and colorants from fabrics and materials.
Next use a cleaner to remove the bleach from the carpet.
Or else you may risk pushing the bleach deeper into the carpet.
Allow the bleach to sit on the carpet for about 30 minutes to one hour.
Spilled bleach that is not noticed until the bleach has dried or lifted the dye from the carpet is going to require some repair work to recolor the area where the bleach has spilled.
Bleach will destroy the color on any carpet that is rich in color and typically would only need to be used on white or near white carpet that has been stained with a dark hard to remove color.
Use a homemade cleaner.
Pour the solution over the bleach stain and let sit for about 5 minutes.
Be careful not to scrub or rub the bleach as this could worsen the stain.
An old white towel or rag carpet color repair kit you can purchase from amazon or a carpet store directions.
Step 4 wash the carpet.
Use a brush if necessary to remove any stubborn dirt still clinging to the fibers.
At this point you have two options.
Mix tsp of mild dish soap with 1 cup of warm water.
Do not apply bleach to the carpet without first mixing it with water.