What is the relationship between mountain breeze and air pressure? I am studying for my PPL and am having some problems understanding the mountain breeze phenomenon, especially when it comes to my understanding of pressure.

Basically, I've read that during the day mountainsides get warmer, resulting in the air flowing upwards. While at night this mechanism reverses : mountainsides get colder, and the air therefore flows downwards.

I could be ok with this, if I hadn't been told earlier on by my physics teacher, that in general high pressures tend to flow towards lower pressures. I.e warm temperatures flow in the direction of cold temperatures. This would imply that the breeze has to travel the other way around. 

I can't really wrap my head around this. How can I reconcile both concepts ?
There is nothing to reconcile: the higher pressure is where the cool air is. The weather report shows pressure fronts, and the low pressure ones are the ones heated up by the action of the sun.

If the mountainside warms up, the air in contact with it warms up. Warmer air has a lower density and it wants to float upwards, like a hot air balloon on a cold day. Meanwhile, surrounding air not heated up by the mountainside flows into where the heated air was, going from cool to hot. The reverse happens when the mountainside cools down: air gets denser and it wants to sink - when it hits the mountainside it just follows that down.

In a vessel with a constant volume, the higher pressure is at the hotter gas. In the unlimited volume of the atmosphere, the gas can expand as it pleases.