With the widespread use of smartphones and embedded devices, data security issues have become increasingly prominent. Among them, the file system, as a key part of storing and managing data, pl ays a crucial role in its stability and security. YAFFS2 file system has become one of the most commonly used file systems in these devices due to its excellent performance and stability. However, data loss can occur due to various reasons such as accidental deletion or hardware failures. Therefore, researching and developing an effective data recovery technique for YAFFS2 file system is of great significance to ensure the safety of user data. Firstly, we conducted an in-depth analysis of the structure and characteristics of the YAFFS2 file system. YAFFS2 is a file system specifically designed for NAND Flash, which adopts a log structure to effectively handle random writes to NAND Flash. In addition, YAFFS2 also has self-repair and garbage collection functions, further improving its stability and reliability. Next, we introduced common data recovery methods. These methods mainly include file header-based recovery, content-based recovery, and metadata-based recovery. However, when dealing with complex data recovery tasks, these methods often suffer from low efficiency or poor recovery results. To address these issues, we proposed a multi-version data recovery algorithm based on hash chaining and a time series construction method based on timestamps. Both method s are designed based on the characteristics of the YAFFS2 file system. The multi-version data recovery algorithm based on hash chaining can effectively handle multiple versions of files, improving the accuracy of data recovery. On the other hand, the time series construction method based on timestamps can effectively handle the continuity of data, improving the efficiency of data recovery.