Martensite memory in cobalt