简体   繁体   中英

Hard reset to a previous git Commit - Not working

I have run

git log

And find this-

    C:\WAMP\www\gtwhero [panelist_qa_AJAX_solution]> git log
    commit afbda8a710aab851937532543bb0a99f246874e3
    Merge: 19323e3 cfde9ef
    Author: S. M. Abrar Jahin <abrarjahin@live.com>
    Date:   Sun Oct 11 00:51:40 2015 +0600

        Merge branch 'panelist_qa_AJAX_solution' of https://github.com/techmarket/gtwhero into panelist_qa_AJAX_solution

    commit 19323e3d1c8055c324a7ed65c3868e92420aad9f
    Author: S. M. Abrar Jahin <abrarjahin@live.com>
    Date:   Sun Oct 11 00:48:43 2015 +0600

        nothing

    commit cfde9eff38fccd15dfc521e7ba075622a31a5a6e
    Merge: 38a68bd b773dd2
    Author: Platon <heonozis@mail.ru>
    Date:   Sat Oct 10 17:08:30 2015 +0300

        Merge remote-tracking branch 'remotes/origin/master' into panelist_qa_AJAX_solution

        Conflicts:
            app/Http/Controllers/WebinarController.php

    commit b773dd225b8ffa34cb9231a4e58063756d7e53f1
    Merge: 1d9923d 21f19e3
    Author: Platon Mysnyk <Heonozis@mail.ru>
    Date:   Sat Oct 10 16:04:29 2015 +0300

        Merge pull request #98 from techmarket/fix-webinar-hosts-all-questions-issue

        Fix webinar hosts all questions issue

    commit 21f19e3585329d3d2006e32254ff62808b241f90
    Author: Ronak <coolronak.shah@rediffmail.com>
    Date:   Sat Oct 10 16:27:21 2015 +0530

        Reverse the QA order in Webinar host Layout

    commit ea539597995011952b2ca083ae61b4ca1c4176aa
    Author: Ronak <coolronak.shah@rediffmail.com>
    Date:   Sat Oct 10 16:12:28 2015 +0530

        Fix Webinar Host Layout QA section update and Also changed the Alert message for Vote chart refreshed in host layo
    commit 38a68bda7d0e7c13d92bf42f791f9c3e805d909d
    Author: S. M. Abrar Jahin <abrarjahin@live.com>
    Date:   Sat Oct 10 16:23:39 2015 +0600

        "panelist_id" and auth fix with help of @Ronak

    commit 3ba2bfea5d7ad8ff4a83b23595c7a9841bc064b2
    Author: S. M. Abrar Jahin <abrarjahin@live.com>
    Date:   Sat Oct 10 13:31:08 2015 +0600

        Animation for removing item

    commit 2181c108c76f187c09744ae6df131f8f80f0b16d
    Author: S. M. Abrar Jahin <abrarjahin@live.com>
    Date:   Sat Oct 10 12:27:53 2015 +0600

        Animation Added in QA

    commit 180337bfe91686d137e3222c196e626f712832b1
    Author: S. M. Abrar Jahin <abrarjahin@live.com>
    Date:   Sat Oct 10 12:17:34 2015 +0600

        All AJAX of this page "http://localhost/gtwhero/public/webinar/LB42JgKdjEAOAe5b37MV/panelist" done

    commit e25c6c19605627a00ca033139c2d98af0feacacf
    Author: S. M. Abrar Jahin <abrarjahin@live.com>
    Date:   Sat Oct 10 07:45:42 2015 +0600

        Before breakfast - done, remaining AJAX query

The code is already pushed in github.

I want to go back to the state when I have made a commit-

    commit 3ba2bfea5d7ad8ff4a83b23595c7a9841bc064b2
    Author: S. M. Abrar Jahin <abrarjahin@live.com>
    Date:   Sat Oct 10 13:31:08 2015 +0600

        Animation for removing item

So, what I had tried is-

git reset --hard 3ba2bfea5d7ad8ff4a83b23595c7a9841bc064b2

When I run it, it says, " HEAD is now at 3ba2bfe Animation for removing item "

But I am finding that, it is not the state when I had made the commmit.

What can I do, can anyone please help?

When I run it, it says, "HEAD is now at 3ba2bfe Animation for removing item". But I am finding that, it is not the state when I had made the commit.

The branch you were on when you ran reset , as well as your checkout, is now at 3ba2bfe. If the content is not what you expected it to be, with respect, you've mis-remembered that commit. You can check by checking out that commit, git checkout 3ba2bfe , and looking at the content or git show 3ba2bfe to see the diff.

The only other explanation is when you say "it is not the state when I had made the commit" that "it" is something else. I assume you're referring to your local branch. Or are you talking about the branch on Github?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM