Your experience was very scary

and I have had similar ones which is why I firmly believe that obedience training is essential for any dog, especially our little stubborn, head strong terriers. You don't HAVE to take a formal obedience class, although I would highly recommend it, but there are tons of ways to learn to train your dog yourself. There are books and lots of advice on the internet.
The safety of our babies demands that we train them to come on command as well as to stay, leave it and drop it.
I know you hit her and yelled at her because you were scared and upset but hitting does not work in dog training any better than it does in training a child to obey.

I am sure you did not hit her hard but you have to be very careful not to hurt these little ones.
I am not a professional trainer but I have obedence trained all my dogs since I was 10 years old and I have five dogs now who are all trained as service dogs. I am always happy to help any member here who wants to learn to train their dog. Please feel free to PM me if you would like my help with anything.