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

undoing changes with git-checkout -f

From
Llamikr <lamikr@cc.jyu.fi>
Date
Jan 9, 2006, 21:16 UTC
Message-ID
<43C2D2C4.2010904@cc.jyu.fi>
Hi
Can somebody tell have I understood git-checkout -f wrong as following
does not work as I thought
1) I clone git repo by using command
    git-clone rsync://source.mvista.com/git/linux-omap-2.6.git
linux-omap-2.6
2) I go to cloned repo and create there a new file
    cd linux-omap-2.6
    echo "test" > 1.txt
3) I want to undo the creation of 1.txt by using command
    git-checkout -f

but for some reason the 1.txt is still displayed in the root of linux-omap-2.6 directory. (I have also tried "git-reset --hard" but seems to have same effect) What am I doing wrong?

Mika
Next: Junio C Hamano
Message 1 of 14 in “undoing changes with git-checkout -f”
  1. lamikrJan 9, 2006
  2. Junio C HamanoJan 9, 2006
  3. lamikrJan 9, 2006
  4. Joel BeckerJan 10, 2006
  5. Junio C HamanoJan 10, 2006
  6. Joel BeckerJan 10, 2006
  7. Joel BeckerJan 10, 2006
  8. Junio C HamanoJan 10, 2006
  9. Joel BeckerJan 10, 2006
  10. Johannes SchindelinJan 10, 2006
  11. Alex RiesenJan 10, 2006
  12. Johannes SchindelinJan 10, 2006
  13. Alex RiesenJan 10, 2006
  14. lamikrJan 9, 2006

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.