简体   繁体   中英

How do I remove a file change from a commit that has not been pushed to origin in git?

I have a file that I accidentally added to my most recent commit. I want to remove the changes, but leave the file in the repository. That is because it is a generated sass stylesheet and I always have merge problems with it. Since the server will regenerate it anyway I would really like to just avoid committing it.

进行新的提交,将所有内容置于您希望的状态,然后将其git rebase -i (通过git rebase -i )到您最近的提交中。

在回答这个问题可能会包含你所需要的多为撤消本地提交。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM