Mine became loose at the weekend. To get it realigned I simply, through trial and error, rotated the gear knob against the locking nut.
If for example the knob needs to be realigned clockwise, screw the locking nut clockwise by a slightly lesser amount and then holding the locking nut screw the knob down onto the locking nut.
I hope that helps.
Whilst at it check that the handbrake knob is not loose. If it is give it a tighten with you hand.