可以通过git撤消未分离文件的结帐 [英] Can git undo a checkout of unstaged files

查看:74
本文介绍了可以通过git撤消未分离文件的结帐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过git checkout意外放弃了对本地工作树中文件的修改。这些文件目前没有上演。是否可以撤销此结账?

I accidentially discard my changes on files in my local working tree via git checkout. The files aren't staged at this time. Is it posible to "undo" this checkout?

推荐答案

我相信如果一个文件被修改但尚未添加(staged)它是纯粹的私有。

如果用索引或HEAD版本覆盖,它就不能被GIT恢复(除非你有一份当前工作的副本)。

I believe if a file is modified but not yet added (staged), it is purely "private".
Meaning it cannot be restored by GIT if overwritten with the index or the HEAD version (unless you have a copy of your current work somewhere)."

私人内容仅在当前目录中可见,但未在Git中以任何方式注册。

A "private" content is one only visible in your current directory, but not registered in any way in Git.

这篇关于可以通过git撤消未分离文件的结帐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆