"To not" or "not to"
He taught me not to lose hope.
Is there a difference in meaning between these two sentences? I think I always hear the form of the second sentence being used to imply the same meaning as the first sentence, but for some reason, it occurred to me today that it might not mean the same. It hurts my head when I try to understand it.