Sunnats and aadaab of wudhu

Masah of the head

Q: I am asking that not long ago I found out that while doing wudu at the end when you do masah, I used to wash my ears first then wash my hair couple of times and I found out the real order and started doing it like the order you really should. So I'm asking that I'm not sure what's the ruling on that because some people say it's okay if you didn't know but now I'm sending this question to you because I really want to know?