Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So, contrary to your own point, you did indeed put in some time and learned one of the ways you can fix a "fucked" repo, because it is more convenient to just 'git reset --hard main' than to delete and re-clone.

There are some simple next steps to go from there:

  - notice that you don't have to reset to the main branch, you can put in any branch name
  - it doesn't even have to be a branch name, it can be any kind of reference to a commit
  - 'git reflog' is useful to find out a reference to a commit you recently were on, that you can then give to reset
  - you don't have to use --hard, I personally like using --keep, and sometimes you might want to keep local changes so you don't supply those options at all
  - ...
What you already did is what Zambyte suggested you should do. Of course there is diminishing returns at some point, but that point comes way after 'git commit -am $msg && git push'.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: