search

Home  >  Q&A  >  body text

git switching branches results in loss of unadded code

Accidentally when checking out the branch, I used --force to force switch to another branch (crying), causing the part of the code without add to be lost.
I tried to use git reflog to view the log and created a new tmp branch. It points to the HEAD@ before I moved it, but there is still no way (without add) to get it back. Does anyone have any way to get it back?

Note: I restarted my computer.

伊谢尔伦伊谢尔伦2768 days ago644

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:29:09

    Remember to use it next timegit stash
    It is common to lose code if you are not proficient in version control. You can check it in the IDE's history.

    reply
    0
  • 黄舟

    黄舟2017-05-02 09:29:09

    There is no way --force is dead.

    reply
    0
  • Cancelreply