Question: A player makes a practice swing and accidentally moves the ball in play with his club. Has he made a stroke?
Answer: No, He had no intention of moving the ball. However, he incurs a penalty stroke under Rule 18-2a for moving his ball in play and the ball must be replaced.
It is worth noting the words “moves the ball in play”. If the ball was not in play ie On the tee box ready to start a new hole, there is no penalty.
Message …. Move it back, add a penalty stroke and take more care next time.