我使用 git rm -r 删除了 Rails 应用程序中的 db 文件夹
我试过了
git reset HEAD
and
git reset --hard HEAD
但迁移文件不会回来。我尝试提交,然后运行重置,但仍然没有任何结果。
我应该怎么办?
您可以从仍然存在的提交中检出该文件。以下是具体操作方法。
git checkout <commit where the file still exists> -- db
# Example:
git checkout 6936142 -- db
# This also works, but if you have a branch named the same as the file or path,
# it will throw an error.
git checkout 6936142 db
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)