I have a water pipe in an unheated garage, how can I protect it from freezing?

Wrap the pipe with a heat tape, which comes in different lengths.