恢复.orig文件的简单方法?

Dav*_*ver 11 mercurial

我刚走了,不小心跑了hg revert *.Mercurial是否附带了将所有.orig文件移回原位的工具?

Ry4*_*ase 11

不,如果您正在使用bash,您可以随时执行:

for thefile in *.orig ; do cp -v $thefile ${thefile%%.orig} ; done
Run Code Online (Sandbox Code Playgroud)

  • 在启用了Command Extensions的Windows命令提示符下,你可以执行`for/f%i in('dir/s/b*.orig')do @copy%i%~dpni` (8认同)
  • 这是一个将你的整棵树(即递归到你的文件夹)中找到的东西.-name"*.orig"| 读取f; 做cp -v $ f $ {f %%.orig}; done` (4认同)