Traumatic childhood coming back...

Does anyone else feel like their experience as a mother brings back terrible memories of their own childhood? Sometimes I just feel such love for my baby, and it makes me sad thinking about parts of my childhood. It also scares me wondering if as my child gets older, will I start to model the behaviors of my parents? It's a struggle sometimes when my toddler is acting naughty because my first instinct is to spank, even though I hate the idea of spanking, it's just what I wanted raised with.

I feel like my childhood is haunting me. I don't know what to do. My childhood was filled with neglect and emotional abuse, and I'm so worried of becoming my parents. What can I do?

Edit: thanks everyone, I will try those suggestions! Esp the books.