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

Re: getting started, happy with cmd line on windows [Scanned]

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Dec 26, 2008, 16:39 UTC
Message-ID
<495508B9.7070103@lsrfire.ath.cx>
In-Reply-To
<BB5F02FD3789B54E8964D38D6775E718242D07@ALTMORE-SVR.altmore.local>
Conor Rafferty schrieb:
> I then deleted all files from the working directory, so I can pull out
> ONLY the ones in version A.
> I tried both fetch and checkout - but nothing was copied into working
> dir How do I do this ?

git treats deleted files just like edited files: as having been changed in preparation for the next commit. You can get back all of the tracked files using this command:

	$ git reset --hard

It undoes _all_ changes: tracked edited files will be reverted to their in-repository state, deleted files created again. You can also check out individual files like this:

	$ git checkout ABC.txt

If you just want to get rid of untracked files, you'd use the command "git clean".

In general, if you switch your work tree from one revision to another (git checkout), git tries to minimize the I/O needed. Files that are the same in both aren't touched.

René
Previous: Conor RaffertyNext: Zorba
Message 2 of 7 in “getting started, happy with cmd line on windows [Scanned]”
  1. Conor RaffertyDec 26, 2008
  2. René ScharfeDec 26, 2008
  3. ZorbaDec 26, 2008
  4. Junio C HamanoDec 26, 2008
  5. ZorbaDec 27, 2008
  6. Daniel BarkalowDec 28, 2008
  7. ZorbaDec 30, 2008

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.