简体   繁体   English

强制推送 Git 中的文件并删除本地 repo 中的所有更新文件

[英]Forcefully pushed files in Git and deleted all updated files in local repo

I have forcefully pushed files to the remote repo and all updated files were deleted in my local repo.我已将文件强制推送到远程仓库,并且所有更新的文件都已在我的本地仓库中删除。 those pushed files visible are in the remote repo as committed files but I can't retrieve them at all.那些可见的推送文件在远程仓库中作为提交的文件,但我根本无法检索它们。 what can I do to retrieve them?我该怎么做才能找回它们? thank you!谢谢你!

those pushed files visible are in the remote repo as committed files but I can't retrieve them at all.那些可见的推送文件在远程仓库中作为提交的文件,但我根本无法检索它们。

Start by cloning again your repository: you should get your files there.首先再次克隆您的存储库:您应该在那里获取您的文件。
If there are listed in a different branch, you can git switch to said branch.如果在不同的分支中有列出,可以将git switch到该分支。
If they are listed in a past commit, you can git restore them.如果它们在过去的提交中列出,您可以git restore它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM