什么时候需要覆盖本地文件? (When do you need to overwrite local files?)
If you feel the need to discard all your local changes and just reset/overwrite everything with a copy from the remote branch, then you should follow this guide.
如果您需要放弃所有本地更改,而只是使用远程分支的副本重置/覆盖所有内容,则应遵循本指南。
Important: If you have any local changes, they will be lost. With or without --hard
option, any local commits that haven’t been pushed will be lost.
重要提示:如果您进行任何本地更改,它们将会丢失。 无论是否使用--hard
选项,所有尚未推送的本地提交都将丢失。
If you have any files that are not tracked by Git (e.g. uploaded user content), these files will not be affected.
如果您有Git不能跟踪的任何文件(例如,上载的用户内容),这些文件将不会受到影响。