2005 chevy 1500

when a/c is blowing cold,instantly goes to max HOT.compressor still running.shut off engine,restart,and usually blows cold again. what is the cause,what is the fix?