While everyone knows that a good night’s sleep restores energy, a new study finds it resets another vital function: memory.