in the heat of the moment I hit one of the opponents balls with my cue, I realized I was wrong in doing so and stopped it, put it back in place and apologized.
Usually the way it works with cue ball foul only is that after you accidentally hit or somehow foul against your opponent's balls you need to let them know and then THEY decide if they want to leave the ball where it is or put it where it was if they know where it was.
Remember they were not the ones who fouled so this puts more responsibility on the player at the table making sure they don't do this.
This isn't your situation but in the middle of a game, NOT letting them know you hit their ball and either just picking up the foul ball and putting it where it was or leaving it where it is and keep on playing is a foul and ball in hand for the incoming player.