* ¿Qué dijiste? This is the most common and generally appropriate translation. It's informal but perfectly acceptable in most situations.
* ¿Qué dijo? This is the formal "you" (usted) version. Use this when speaking to someone older, someone in a position of authority, or someone you don't know well.
* ¿Qué has dicho? This is another informal option, using the present perfect tense. It implies a slightly stronger sense of surprise or disbelief than "¿Qué dijiste?".
* ¿Perdón? or ¿Perdona? This translates to "Pardon?" or "Excuse me?" and is used when you didn't hear what someone said. It's not a direct translation of "What did you say?", but it serves the same purpose. "Perdona" is informal, "Perdón" is more formal.
The best option depends on the context. For most everyday conversations, ¿Qué dijiste? is perfectly fine.