If your ball ends up on the wrong green, or the wrong green gets in the way of your stance or swing, you must take free relief. You are not allowed to play the ball as it lies there.
What do I do?
Find the closest spot to your ball that is no nearer the hole and where the wrong green no longer touches your ball, stance or swing. Drop a ball within one club-length of that spot, no nearer the hole, in the same kind of ground your ball was on, and fully clear of the wrong green. See Taking relief: measuring and dropping correctly.
There is no penalty for taking relief. If you hit the ball from the wrong green, or from outside the relief area, the penalty is two strokes in stroke play.
When is there no relief?
There is none if the interference exists only because you picked a club, stance or swing that is clearly unreasonable for the situation.
Can I roll a ball to check the wrong green?
No. Rubbing a green or rolling a ball on it to test it, including a wrong green, is a two-stroke penalty during a round.
The governing rule is Rule 13.1.
Local rules
Your league's committee may have local rules that change this. Ask the organizer which ones your league uses.