Might have lost a lot of code - anything I can do?

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

Might have lost a lot of code - anything I can do?

Post by /RaspberryPi »


Edit: Resolved, and code restored - see comments

I have a seasonal project on my Raspberry Pi 4B, and I might have lost a lot of code.

My last commit from the Pi to Github was on November 17, 2022, but I kept making local code changes to it for over a month after that, before putting the RPi away after Christmas without committing my changes to GitHub.

I then made some changes to the project from my Desktop in February, which I did commit to GitHub.

Just last week I brought the RPi out again, and had completely forgotten / not realized that my last month of changes from last year were unsaved. I tried to do a "git pull" to sync it up with the changes I knew I made in February, but it gave me an error and told me to use "git reset", so I did - then pulled the changes to the RPi. Since then I've done a small handful of pushes and pulls to GitHub with other minor changes.

It wasn't until just today that I realized what I had done. I realize this is entirely my own fault. Is there any shot I have at recovering the code? I do not have a particularly great familiarity with how git or github work. Would the RPi have saved those local changes anywhere? Might Thonny have saved backups on its own? I'm open to any ideas at all.

Thank you. Happy to provide any other details that may be relevant. I'll keep trying things on my own in the mean time.
submitted by /u/hnhzshbx
[link] [comments]

Source: https://www.reddit.com/r/raspberry_pi/c ... _i_can_do/
/RaspberryPi
Post Reply

Return to “Raspberry Pi Forum”