Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+22 votes
asked in CSC335 Fall 2022 by (1 point)

2 Answers

+7 votes

If you previously committed the file to git, then yes, you certainly can.

  • If it had been committed and pushed, you can browse to find it on GitHub and redownload it from there.
  • If the file had only been committed locally and not pushed, I think git restore your_file_name should do the trick, to bring back the most recently committed version of that file.

However, even if you didn't commit it to git, there's a decent chance you can recover it using Eclipse's "Local History". See: https://stackoverflow.com/questions/5451175/is-it-possible-to-get-the-deleted-file-from-eclipse-workspace

Hope that helps!

answered by (4.9k points)
+1

Thank you for the insight, this post helped me restore a file that I accidentally deleted.

+6 votes

I think you can restore it as long as you didn't click on the checkbox that says "Permanently delete from computer" when you deleted it.

answered by (1 point)
...