William Seiti Mizuta @williammizuta Caelum | Ensino e Inovação www.caelum.com.br
On Mon, Apr 29, 2013 at 3:16 AM, Lei Yang <[email protected]> wrote: > hi > > You misunderstand my question,I want to recover my local changes, after I > do a hard reset ,it's gone. > > Sent from my iPhone > > As Thomas said, you can find the stage before the git reset with "reflog" ( http://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html). For this, you can use git reflog command or git log -g command and get the hash of the state before the git reset command command. With the hash, you can use git merge or rebase with you have new commits that you want to preserve or git reset --hard again to reset to the state before the previous git reset command. > On 2013-4-29, at 14:10, John McKown <[email protected]> wrote: > > > I'm no expert, but I'd try: > > > > git reset --hard local_commit > > > > if "local_commit" is some sort of name. Or it can be that long 40 > > character commit value. If you don't know where you want to go back > > to, you might try a > > > > git log > > > > to find the commit value and use it (cut and paste if possible. I > > don't like typing "random" 40 character values.) > > > > Well, it's 01:00 local time. You'd think that a 60-year old would know > > better than to drink a large caffeinated beverage before bed time. > > You'd be wrong, in my case. > > > > BTW, did you mean to do a --mixed (reset HEAD & index) or --soft (only > > reset HEAD). > > > > Note if you did some work between the > > > > git commit local_commit^ > > > > and the > > > > git reset --hard > > > > then you can't recover those changes at all. git did not track them > > and so they are GONE and totally unrecoverable. The reset --hard reset > > both the files in the directory and the index. > > > > On Mon, Apr 29, 2013 at 12:28 AM, lei yang <[email protected]> > wrote: > >> Hi experts > >> > >> I commit a change to my local git repos, but I did a git hard --reset > >> local_commit^, and then my local changes disappeared, how could I > >> recover my local changes ? > >> > >> Thanks > >> Lei > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups "Git for human beings" group. > >> To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > >> For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > -- > > This is a test of the Emergency Broadcast System. If this had been an > > actual emergency, do you really think we'd stick around to tell you? > > > > Maranatha! <>< > > John McKown > > > > -- > > You received this message because you are subscribed to the Google > Groups "Git for human beings" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Git for human beings" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
