Starting with OS X El Capitan, Apple, Inc introduced System Integrity Protection (SIP), a security feature that protects the essential parts of OS data on the system disk from unwanted alterations. It increases the level of system security, but at the same time severely restricts access to files on the disk, rendering file recovery impossible. It should be disabled to perform file recovery.
To do this:
1. Restart your Mac computer.
2. Simultaneously press and hold the Cmd and R keys during startup and boot the computer into the macOS Recovery mode.
Mac startup in recovery mode
Click image to enlarge
3. Go to the Utilities menu and select Terminal.
macOS Utilities
Click image to enlarge
4. In the Terminal, type in "csrutil disable" and press Enter. There should be a message that System Integrity Protection was successfully disabled.
SIP disabled
Click image to enlarge
5. Restart your Mac computer and continue with file recovery.
When the recovery process is over, System Integrity Protection should be re-enabled again.
To do this:
1. Proceed with above steps 1 to 3.
2. In the Terminal, type in "csrutil enable" and press Enter. There should be a message that System Integrity Protection was successfully enabled.
SIP enabled
Click image to enlarge
3. Restart your Mac computer.