Install OS X replacing Windows on a Mac without losing data
There is no way to reinstall OS X without formatting and losing data. If you want to keep your data, recover the data to another drive or to the cloud.