-2

I'm a newbie to programming, having just taken AP computer science, and not experienced with Github. I was asked to make a github, so I made one and synced all my changes there. I made a few changes, then tried to sync them. I opened github, and clicked sync, but it said I had uncommited changes, so it told me to delete them, so I did, then synced, and all my work was lost, as the old version was downloaded.

I'm guessing I can't undo this, but I'm still optimistic, is there some way to recover it?

This is kind of unrelated but: I have .jars of my newest work, but when I decompile them with jdgui, the for each loops get messed up. I'm also guessing its not possible for a compiler to read for each loops, but again I'm optimistic, is there some way to decomiple them cleanly with for each loops?

Bla1
  • 3
  • 3
  • 1
    You have off-topic ( asking for recommendations ) as well as multiple questions in a single question. Read [How to Ask](http://stackoverflow.com/help/how-to-ask) –  Oct 19 '14 at 04:09
  • *"is there some way to recover it?"* - Unless you have an independent backup, the answer is probably no. Mark this down to experience, and do the work over again. – Stephen C Oct 19 '14 at 04:13
  • *"is there some way to decomiple them cleanly with for each loops?"* - If the decompiler won't do it, then no. The problem is that the ".class" files do not contain enough information to faithfully reconstruct the original source code. The theoretical best the decompiler can do is generate source code that will compile to the bytecodes you have. – Stephen C Oct 19 '14 at 04:14
  • Ah ok I see.. thanks for the info. I guess I'll just have to restart then. – Bla1 Oct 19 '14 at 04:26
  • You can try another decompiler like Procyon or CFR, which may yield better results than JD-GUI. – Mike Strobel Oct 20 '14 at 13:27

1 Answers1

0

If the files were not staged (added to the index of the local Git repo), then no, you cannot get back those files with Git alone.

You would need to select the files (in the G4W -- GitHub For Windows -- GUI) you want to commit and commit first, before trying to sync.
See this question for instance.

Only a file recover/undeleter tool would be able to try and recover that work.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250