如何带回没有在git中提交的隐藏文件?

伯纳德

我试图找出我最近5个小时的工作藏在哪个分支。我误输入了stash,所有更改都消失了!

我偶然输入了:

git stash

这是我所看到的在此处输入图片说明

然后我检查了我的分支:

然后,我试图带回自己的藏匿处。我结帐到我的分行并输入

git stash pop

现在我得到了:

(use "git reset HEAD <file>..." to unstage)

    new file:   ******************/UIViewController+Keyboard.h
    new file:   ******************/UIViewController+Keyboard.m

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   ******************.xcodeproj/project.pbxproj
    modified:   ******************/CTAuthenticateUserViewController.m

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    ******************/Base.lproj/Bernard copy.storyboard
    ******************/Base.lproj/Bernard.storyboard
    ******************/Keyboard.h

我猜这是对的:

(use "git reset HEAD <file>..." to unstage)

这意味着通过升级它们来删除我所有的隐藏文件!

use "git add <file>..."

这会将当前文件替换为隐藏文件吗?

"git checkout -- <file>...

隐藏的更改进入bin,最后一次提交变为head

 "git add <file>..."

这会将这些文件添加到当前分支(来自存储)中

吸血鬼

这样做git stash pop会将隐藏的更改应用于当前已检出的工作树。如果命令没有给出任何类似“出现冲突”之类的错误,则git能够应用更改并从存储堆栈中删除存储提交。stash applystash pop完成之后,它执行a操作,git status以便您查看工作树的当前状态。隐藏还保留您添加到索引中的内容以及您刚刚修改而未添加到索引中的内容。因此,您应该现在将所有工作恢复原样,并且可以继续进行。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章