The game of golf is about making successive strokes to get your ball from the teeing area into the hole in as few strokes as possible. But what exactly is a stroke and how do you make one properly?
A stroke is the forward movement of the club made to strike the ball. This means that if you hit your ball with your club when you didn’t mean to, that isn’t a stroke. (There might be a penalty if your ball is in play and it moves, but it’s not a stroke). Making a stroke requires the intention to strike your ball.
You can even decide not to hit your ball in the middle of your swing. As long as your intent to hit the ball stops before you reach it, and you successfully stop the club or avoid hitting the ball, a stroke hasn’t been made.
This principle also applies to a practice swing that accidentally hits your ball. Since you were not trying to hit your ball with the practice swing, it does not count as a stroke. Again, there may be a penalty involved here depending on where on the course this occurred, but a stroke has not been made.