简体   繁体   中英

Mac OS X restore files deleted by git rm

i just messed up big. The way it happened is so emberassing that I won't write it down :)

So here's my problem:

  • Github Repop deleted
  • Local repo files delete by git rm -r
  • Local repo new initalized

Is there any chance how to restore my data? Luckily it's in a very very early stage of this project.

Regards

git reset HEAD

如果您没有任何未提交的更改,请使用

git reset --hard HEAD

I am not sure I completely understand the state of your local repo, but if all you did was a git rm -r * and committed that, then everything is still there. You can just reset to the previous commit:

git reset --hard HEAD~1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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