我所做的是:在初始化回購中還原git rm -rf。
$ git init
$ git add .
# bunch of unwanted files were also added
$ vim .gitignore
$ git rm -rf *
$ git add .
# but the files were actually deleted from the ./ folder.
現在我必須在目錄中只的.gitignore病毒碼文件。所有必要的文件都沒有了。
由於在這個崗位How to revert a "git rm -r ."?
提的是git reset HEAD
的路要走?
我不知道我應該運行這個命令,因爲我還沒有提交任何提交到現在。
'git reset HEAD'說未知版本 –
'git log'看你init初始化SHA然後'git checkout'? –
ItayB
'git log' ==>'fatal:您當前的分支'主'還沒有任何提交 ' –