Undo deleted files in git?

前端 未结 3 833
盖世英雄少女心
盖世英雄少女心 2021-01-24 18:37

Newbie needs some help undoing a mess!

I was tring to push my site to a git repository, so I used the git add command. Then, before I did the commit, I realized I had a

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-24 19:30

    have you tried git reset --hard (commit # before this horrible accident)?

    then use git pull origin master to extract files from the online git repo to get your files back.

    A more in depth explanation of this process is located on this SO thread.

提交回复
热议问题