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

Re: three questions: proper forum? & reverting changes to the working directory

From
Andy Hawkins <andy@gently.org.uk>
Date
Nov 8, 2012, 14:54 UTC
Message-ID
<slrnk9nht6.rce.andy@atom.gently.org.uk>
In-Reply-To
<A6B9336CDB62BB46B9F8708E686A7EA0115BAA1404@NRHMMS8P02.uicnrh.dom>
Hi,
In article <A6B9336CDB62BB46B9F8708E686A7EA0115BAA1404@NRHMMS8P02.uicnrh.dom>,
           McKown, John<John.McKown@healthmarkets.com> wrote:
> 1) is this the proper forum for asking general git usage questions, such
> as "how to"?  If not, what is?
I'd say that here is fine. #git on freenode is also a good source of advice.
Show 9 quoted lines
> 2) I am unsure that I did things the "proper" way. I have a git maintained
> subdirectory.  I made some changes and saved them in the working
> directory, but did not "git add" or "git commit" them.  I then decided
> that I really messed up what I was doing (basically reformatting some
> source code).  So to revert the changes back to what was last committed, I
> did a "git reset --hard HEAD".  I think this is the proper way.  But I
> picked up that command in the section of the documentation which was
> talking about abandoning a "git merge" attempt.  What I did worked, but is
> it the proper way?  If not, what is?

The easiest answer to this is run 'git status'. It'll list the files in various states, and tell you how to undo the changes.

Andy
Previous: Konstantin Khomoutov
Message 4 of 4 in “three questions: proper forum? & reverting changes to the working directory”
  1. McKown, JohnNov 8, 2012
  2. McKown, JohnNov 8, 2012
  3. Konstantin KhomoutovNov 8, 2012
  4. Andy HawkinsNov 8, 2012

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.