Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これに対する解決策があるかどうかはわかりません:
誤って次のディレクトリをステージングしました:
git add *
そして、これを見て、私はそうしました(重大な、重大な間違い、もちろんステージングされていないはずです)
git rm -r my_directory
さらに、私は次のようにフォローアップしました。
git commit -m ¨horrible commit¨
現在、ファイルはどこにも見つかりません。ファイルを復元する方法はありますか?
ありがとう
私が間違っていなければ、git rm はこのディレクトリを削除すべきではありませんでしたが、次のように不平を言いました。
error: the following file has changes staged in the index: my_directory (use --cached to keep the file, or -f to force removal)
したがって、ディレクトリはまだそこにあるはずです...
-f で実行した場合は、申し訳ありませんが、できることは何もないと思います。