git checkout file 撤销对该文件的所有修改
有时忘记修改了哪些文件,如下命令找到修改的文件
git status -s
M linux-4.19.y/fs/jffs2/acl.cM linux-4.19.y/fs/jffs2/acl.hM linux-4.19.y/fs/jffs2/background.cM linux-4.19.y/fs/jffs2/build.cM linux-4.19.y/fs/jffs2/compr.cM linux-4.19.y/fs/jffs2/compr.hM linux-4.19.y/fs/jffs2/compr_lzo.cM linux-4.19.y/fs/jffs2/compr_rtime.cM linux-4.19.y/fs/jffs2/compr_rubin.cM linux-4.19.y/fs/jffs2/compr_zlib.cM linux-4.19.y/fs/jffs2/debug.cM linux-4.19.y/fs/jffs2/dir.cM linux-4.19.y/fs/jffs2/erase.cM linux-4.19.y/fs/jffs2/file.cM linux-4.19.y/fs/jffs2/fs.cM linux-4.19.y/fs/jffs2/gc.cM linux-4.19.y/fs/jffs2/ioctl.cM linux-4.19.y/fs/jffs2/jffs2_fs_i.hM linux-4.19.y/fs/jffs2/jffs2_fs_sb.hM linux-4.19.y/fs/jffs2/malloc.cM linux-4.19.y/fs/jffs2/nodelist.cM linux-4.19.y/fs/jffs2/nodelist.hM linux-4.19.y/fs/jffs2/nodemgmt.cM linux-4.19.y/fs/jffs2/os-linux.hM linux-4.19.y/fs/jffs2/read.cM linux-4.19.y/fs/jffs2/readinode.cM linux-4.19.y/fs/jffs2/scan.c
恢复对文件所有修改
git checkout xxx(文件名)
git checkout linux-4.19.y/fs/jffs2/scan.c