简体   繁体   中英

How to get back modified file after git checkout and git pull?

I've modified a file, then I want to get latest version from remote.

So I run git checkout to revert the file, and run git pull to get latest version.

After that, I found that I need the modification of the file.

Is it possible to get it back? Thanks!

使用"git stash"存储所有更改,使用"git pull"更新存储库,然后使用"git stash apply"将更改应用回。

如果您已完成git checkout-要恢复文件,则为时已晚...简而言之,更改将丢失...一个更好的主意可能是存储更改而不是恢复更改...

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