[英]How to remove all local files that were accidentally added to the git system
[英]How to remove all added files in GIT
我錯誤地使用git add.
所以所有文件都添加到凝視區。 我想從凝視區域中刪除所有這些文件。
我試過了
git clean -fdx
git clean -df
但它不起作用。
您需要使用git reset --mixed
。
--mixed
是否用於清除階段/緩存/索引區域。
你也可以這樣做:
git reset . <-- will remove files from current index
git reset <filename> <-- for a specific file.
如果是這樣的話,那么git reset HEAD
就可以了
嗯......我幾乎有同樣的問題,我將我的用戶文件添加到 git。 然后在我的用戶文件中單擊選項並申請顯示隱藏文件。 然后我找到了名為 git 的隱藏文件。 我只是刪除文件。 之后我添加的每個文件都消失了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.