All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
First of all, we thank you for avoiding touching non-Mahram women, so may Allaah reward you.
From what you mentioned in the question, you are wrong in three aspects:
1- Disciplining by hitting is only the right of the guardian or the Muslim ruler, and you are not one of them.
2- If we presume that you have the right to discipline her, then the discipliner does not discipline while he is angry, because anger may render the person unable to control himself, and what happened is that you hit this girl while you were angry.
3- It is clear that what you did was out of zeal (for yourself), and you did not do so for the sake of Allaah; Allaah Says (what means): {And who has (in mind) no favour from anyone to be paid back, Except to seek the Countenance of his Lord, the Most High.}[Quran 92:19-20]
Therefore, you are obliged to advise your uncle in a nice and soft manner to do his obligation towards his daughter and nurture her and take care of her in a good manner, and discipline her. You should remind him of the Saying of Allaah (which means): {O you who have believed, protect yourselves and your families from a Fire whose fuel is people and stones.}[Quran 66:6], and the saying of the Prophet : “Allaah will ask every guardian about that which was entrusted to his care.” [At-Tirmithi] However, Ibn Hibbaan reported this narration with an addition “…either he took care of it or neglected it.”
Allaah Knows best.