Accidentally deleted src from catkin_ws

I was supposed to delete a folder, but accidentally deleted the src folder from catkin_ws. Is it possible to restore the content? I went on and pressed ctrl-z, but only one folder - not even a package - was restored.

Never mind. I used these commands to restore to factory settings:
rm -rf /home/user/catkin_ws/src/
rm -rf /home/user/catkin_ws/build/
rm -rf /home/user/catkin_ws/devel/
mkdir -p /home/user/catkin_ws/src/
cd /home/user/catkin_ws/
catkin_make

Hi @Olavio ,

Welcome to the Community!

Glad to know you were able to find a solution by yourself and restore your folder.

As a tip for you for the future, you can Download the catkin packages that you create into your computer so you can restore them back, in case this mishap happens again.

You can simply right click on the packages you see under catkin_ws/src folder and click Download - from your IDE left panel in the course. You can later just “drag-and-drop” them into the IDE folders from your computer to restore them in the course directories.

This way you can make sure you do not lose files accidentally!

Regards,
Girish

This topic was automatically closed after 21 hours. New replies are no longer allowed.