[英]how to revert one single file of a commit with multiple files
假設我已經提交了 5 個文件。 提交后,我注意到我需要撤消對這 5 個文件中的一個文件的更改。 這可能嗎? 如果不是最好的,為什么要撤消對一個文件的更改?
從 ChatterOne 擴展(並對他的評論稍作調整),如果您想要修改修訂版(並忘記錯誤的修訂版):
git checkout HEAD~ -- path-to-file
git commit --amend --no-edit # replace the revision that I just created with this new revision I'm creating
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.