Rules of Golf - Accidental movement of your ball
Rules
Accidental movement of your ball

The default position is that there is still a penalty if you move your ball at rest, even if accidentally.

Many golfers appear to believe that there's no penalty if you accidentally move your ball in the general area, possibly because they have mistakenly read too much into certain exceptions that now exist- i.e., no penalty for accidental movement of your ball on the putting green (even on a practise stroke) or when searching for your ball.
But in the general area, bunkers or penalty areas, there is still a one-stroke penalty for moving your ball at rest, even if accidentally. You must also remember to replace it back to where it was lying, too, before playing your next shot to avoid a two-shot penalty for playing from a wrong place. (Rule 9.4).