Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
git pull我已经修改了一个文件,并希望从我编辑它的服务器获取该文件而不进行修改。如何从服务器下载文件,或恢复文件的初始状态?
git pull
如果文件只是暂存,您可以这样做来取消暂存文件:
git reset HEAD filename
然后丢弃您对其所做的修改:
git checkout -- filename
您可能正在寻找 git stash 命令