GIT restore last detached HEAD

前端 未结 7 1807
醉梦人生
醉梦人生 2020-12-07 12:06

Please, I have a big problem in my project: this is the scenario. I have an xcode project under GIT. Today I realized that the last commit broke some tests, so i checked out

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 12:48

    1. First, run git reflog to view history.
    2. The oldest revision will be the last one in the list.
    3. Switch to your desired commit using git checkout -b temp e35d2b3 here e35dd23 is the hash value of your commit.
    4. That's it. Now just do git add . etc....

    Accept it as an answer if it solves your issue. Otherwise please share your comment.

提交回复
热议问题