You’re about to enter the wonderful world of the British class system and its approach to manners.
The answer to this question will depend on how you were brought up and your parents social class.
Some people consider “what” to be rude and abrupt. Others consider “pardon” to be twee and mealy mouthed and a bit common.
I say life is too short to worry too much about this. I wouldn’t find it rude if you said “what?”