Step 1: Identify the reporting verb change:
Direct 'said to' becomes indirect 'asked' for a question.
Step 2: Rework the question clause:
The question word 'what' is retained but the clause changes to statement word order and the verb moves further into the past.
Step 3: Final Answer:
He asked me what I had done the previous day.