I accidentaly deleted the ros2_ws

While taking the ROS2 Basics in 5 Days (Python) course, I accidentally deleted the ros2_ws directory. Everything is gone and I don’t know how to get it back or fix it. I have tried to reopen the course but it still does not appear. Please help me.

Hi @btapia ,

Welcome to this Community!

If you did any form of the following two commands:

rm -rf ./ros2_ws

OR

sudo rm -rf ./ros2_ws

then your ros2_ws folder and its contents are irrecoverably gone out (purged) of the system.
There is no way of getting them back. [Unless your virtual machine has saved your most recent environment data, but that is highly unlikely.]

Sorry to break this bad news. Please make sure you execute commands after understanding what you are about to do from the next time onward.

Regards,
Girish

Ou! I inadvertently executed the command, thinking that I had copied another command from the notebook. But thanks for the response!

There is hope.

We can try restoring a version of your workspace before the ‘disaster’ (if one exists). In your case, it seems it did.

Perhaps the last version on April 26 will serve your purpose, so that at least you don’t have to start over from zero. Please let us know.

1 Like

Thanks! I think one of today’s versions has to be good. You can try restoring the latest 9:37 and in case that is the corrupted one try the previous one.

Hi @bayodesegun can you restore my system also to yesterday please? agentofgod75@gmail.com is my account

@btapia
Are you sure? When did you delete the files?

@agentofgod75
Solved here. Please ask further questions about this in that thread.

I checked when I created the new ros2_ws directory and at 9:55. So I have assumed that I have deleted the directory before that. I want to try to recover the 9:37 version and in case it’s not I’m sure the 6:45 is fine.

I restored the 6:45 version, because the 9:37 version was the latest and default downloaded to your workspace, and you couldn’t find the files there.

Anyways, we can always restore another version.

Thank you, I have recovered all!!

Hallelujah :raised_hands:! I’m glad you recovered all!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.