Your daughter is more than likely upset about something ,,finding out what it is would help her more than punishment, check out if anything has hapopened at school has there been a change in her life at home, usually parents can pin point an issue and resolve it, give her plenty of positive attention and get her playing games and sports ,outside activities.
I am not sure that punishment works, I will not be surprised if you see more accidents now. She may have some gastro-intestinal problem. How regular is she? Does she fo at school, or home? Remind her to go at her normal "hour" - I have to do it with my son as he tends to hold his bowels in. She also may be constipated.
Good luck