- 撤銷只修過文件(未執行 git add)
git checkout -- file.txt
- 撤銷已添加到暫存區(執行 git add,未執行 git commit),也就是取消使用git add命令添加的文件
git rm –-cached filename
或者是
git reset head file.txt
- 撤銷已添加到版本中(執行過 git commit)
git reset HEAD~1 // 回退到上一個版本
git reset 版本號 // 指定到某個版本
git checkout -- file.txt
git rm –-cached filename
或者是
git reset head file.txt
git reset HEAD~1 // 回退到上一個版本
git reset 版本號 // 指定到某個版本
繼續運行 🥋 回憶上次內容 上上次 真寫了 萬行 代碼 這 萬行 代碼 都是寫在 明面 上的 這次 使用git命令 下載了 github上面的倉庫