Vw golf won't go into reverse

today my car decided it didn’t want to shift into reverse. i pulled the parking brake, and voila! that “fixed” the problem. it shifted without any trouble. it’s happened twice again today, and once even pulling the hand brake did NOT help. any ideas what’s going on? what i should have repaired?

Manual or automatic transmission? In either case I would suspect the linkage.

automatic transmission. why does it shift into gears when i pull the parking brake?