My DMIL's friend had a gynae op to investigate some issues she was having. They opened her up, and found a teeny, tiny foetus - she didn't know she was pregnant. They sewed her back up, and that teeny, tiny foetus is now nearly 19, and an exceptionally clever girl.
In the very early stages of pregnancy (which I imagine you were) the baby hasn't attached to the wall of the womb yet, so nothing you do at this stage will affect it.
I had a major back operation when I was about 8 weeks pregnant with my second child (like you I hadn't realised I was pregnant) I had been told the medication I was on could stop my cycles and was not given a pregnancy test before hand. My baby was absolutely fine and the midwife and doctor had reassurred me whilst I was pregnant that it would be fine.
Don't worry - general anaesthetics are not contra-indicated during pregnancy at any stage. Plus you would have been so early that you were most likely not even sharing a blood supply with your baby at the time. Relax