Do microbes have a memory? History-dependent behavior in the adaptation to variable environments