Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    Confirmed! Tried a git reset after a git add . and git was complaining about corrupt HEAD. Following your advice, I could git add & reset back and forth with no problems :)
    – Kounavi
    Commented Oct 3, 2012 at 21:32
  • 1
    The second part works, but it is a bit clumsy. How line endings are handled, depends on autocrlf value... This won't work in every project, depending the settings.
    – sjas
    Commented Mar 29, 2013 at 11:26
  • 1
    This answer was reasonable at the time it was posted, but is now obsolete; git reset somefile and git reset both work prior to making the first commit, now. This has been the case since several Git releases back.
    – Mark Amery
    Commented Oct 30, 2015 at 23:38