git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Newbie in Git. How to get back from last pull?

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Aug 1, 2010, 08:30 UTC
Message-ID
<20100801083000.GF26006@kytes>
In-Reply-To
<1280649966984-5360499.post@n2.nabble.com>
Hi Yankovsky,
Yankovsky writes:
> I have commited all my changes, and accidently typed git pull, then was
> paniced and aborted the operation. now all my changes in project disappear.
> but i have commit. how can i restore my project status using this commit?
> I hope you understand my rus english)
I don't understand exactly what you want to do, but here are the
basics- you can decide what you want to do.
1. Use `git reflog` to see a history of your operations.
2. If you want your working copy to switch to an existing commit, use
   `git checkout <SHA1 of commit>`.
3. If you want to irreversibly destroy everything and switch your
   working copy to a desired commit, use `git reset --hard <SHA1 of
   commit>`. Use with care!
Hope that helps.
-- Ram
Previous: YankovskyNext: Miles Bader
Message 2 of 6 in “Newbie in Git. How to get back from last pull?”
  1. YankovskyAug 1, 2010
  2. Ramkumar RamachandraAug 1, 2010
  3. Miles BaderAug 1, 2010
  4. Andreas SchwabAug 1, 2010
  5. YankovskyAug 1, 2010
  6. YankovskyAug 1, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.