Pitbull’s reaction

So i was walking yesterday with my 3 year old daughter and a pitbull dog was walking towards her to attack her. I crabbed my daughter and walked really fast to my car. He wanted to bite my daughter i saw it in his eyes.

Any spray for dogs in case of an attack?

Any recommendations to prevent just in case i see that dog again?

Any advise?