You won't lose files or data by unlinking OneDrive from your computer. You can always access your files by signing in to OneDrive.com.
Why does unlinking OneDrive delete files?
This is the only reason the files would not have been left on the PC when you unlinked. Once you uncheck the box then the files will be moved back to the hard drive. There is only ONE reason the files would not be there when you unlink OneDrive and this is because Files on Demand is enabled.
How do I remove OneDrive without losing files?
You do not need to keep your documents on OneDrive as well as on your PC.> Open File Explorer>Click on the Blue OneDrive icon>Right click on any folder or file>In the menu click on 'Clear Space'. This will remove the folder or file from your computer.