Hard time to understand a guy 😒😂

Marylou
Here is the situation : 
We've had sex that one time four months ago, him and I, he is a friend who I am working with. We both ended this because it was not right for us. 
Two weeks from now he started to act weird, one day he talks to me and the other i'm hitting his nerves for absolutely no reason and i am a stranger. Yesterday he told me he wanted to have sex again, and today he changed his mind. 
Can someone help me i am totally mindf*cked