I realised I hadn't booked an appointment at the hairdresser's when I arrived there.
- I realised I have forgot an appointment when I got there.
- I realised to have forgotten an appointment when I got there.
- I realised I had forgotten an appointment when I got there.
- I realised I have forgotten an appointment when I got there.