2

Possible Duplicate:
Undoing a git reset --hard HEAD~1

So, I was working in my repo, changed and added some files, committed them, etc. Later on I ran 'git reset --hard head' to undo some stuff, and afterwards realized that I never ran 'git add' on those files earlier on, so they're gone. Any way to revert this?

0

2 Answers 2

1

If it's only been a few days, you're in luck. See How can I undo git reset --hard HEAD~1?.

1

if you never added the files, git doesn't know about them, so if they're gone, they're gone (and even the trick in Undoing a git reset --hard HEAD~1 won't help you.

If you didn't add them, though, and git didn't know about them, reset shouldn't have removed them. If it did, it means it did know, so the answer to the other question applies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.