android studio 我在用git提交代码的时候不知道弄了哪个操作把自己刚写的代码弄丢了


hp@hp-pc MINGW64 /e/AAA_project/android_demo/AS_project/HealthButler-master (master|MERGING)
$ git fetch origin

hp@hp-pc MINGW64 /e/AAA_project/android_demo/AS_project/HealthButler-master (master|MERGING)
$ git reset --hard origin/master
HEAD is now at 40c43df 添加Json测试数据

hp@hp-pc MINGW64 /e/AAA_project/android_demo/AS_project/HealthButler-master (master)
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master


hp@hp-pc MINGW64 /e/AAA_project/android_demo/AS_project/HealthButler-master (master)
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master


rt,因为提交的时候有冲突,所以我本来想解决冲突的,没想到弄了一个pull操作,结果把我自己的代码全部被覆盖不知道哪去了,请问怎么才能找回来,。。之前已经add和commit过的。。

阅读 4.4k
1 个回答

git reset --hard origin/master 哥们这行把你未提交的都删掉了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题