How can I recover files after accidentally running “git clean -df”?

前端 未结 1 1642
忘了有多久
忘了有多久 2020-12-21 09:30

I have accidentally run git clean -df. It removed my files from my current commit, which I had yet to push. Now, in git status, those files are mar

相关标签:
1条回答
  • 2020-12-21 10:32

    git clean only untracked files and not committed ones.

    You might have done other operations if you see D as the status for already committed files.

    You get back those files, do:

    git checkout .
    

    or

    git reset --hard
    
    0 讨论(0)
提交回复
热议问题