我有一种不好的感觉,我的工作丢失了。有没有办法让他们回来?
这是我所做的要点:
# Initially
$ git init -q
$ echo foo >foo
$ git add foo
$ git commit -m initial
[master (root-commit) 399ac4f] initial
1 file changed, 1 insertion(+)
create mode 100644 foo
# Work work work
$ rm foo
$ mkdir foo && echo bar >foo/bar
# This is where things went bad
$ git stash
Saved working directory and index state WIP on master: 399ac4f initial
HEAD is now at 399ac4f initial
$ git stash pop
Removing foo
# On branch master
# ...
no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (c8353a2223b73ceb9aa73fac64829919b68c86e9)
# What happened to my work!?
$ find foo
find: foo: No such file or directory
$ git --version
git version 1.7.11.3
不幸的是,我认为foo/bar
从未见过存储库/索引,因为git
在此之前我没有在其上运行任何命令。