First you have to check if window can go freely in manual mode, sometimes rubber seals can block a pathway and protection detects that something stuck and moves window down.

To reset the "auto" window: with the ignition on, press the window button down and when it completely down hold it for 5 or more seconds. After press up, when it is completely up hold 5 seconds as well.

I didn't try this but read on the forums.