The complex environment of ruins requires the search and rescue robot has the ability of return autonomously. Based on recording and analyzing control instructions and configuration information, the method of autonomous return is introduced to endow the shape-shifting search and rescue robot with ability of return autonomously. We introduced the main process of normal motion mode and autonomous return mode. The structure of data for recording historic control instruction and configuration information is designed. The software structure of autonomous return control unit is designed.