This is Lightroom-specific metadata, stored in the Lightroom catalog. You can verify that with this command¹ in the OS X Terminal:
$ exiftool -b -xmp mypic.dng > orig.xmp
Now go back to Lightroom, reject
mypic.dng, and hit ⌘/Ctrl-S to force Lightroom to save its copy of the metadata to the photo file on disk.² Back in the Terminal, say:
$ exiftool -b -xmp mypic.dng > new.xmp
$ diff orig.xmp new.xmp
That will tell you what changes Lightroom made to the photo's embedded metadata. All you'll see are a metadata date change and some UUID changes. You will not see any mention of a "Rejected in Lightroom" type of field, because there isn't one. There is nothing there for
exiftool to manipulate.
You'll have to do this in Lua, as a Lightroom plugin. Once you have the
LrPhoto reference, you simply say:
to get the current value. It will be 1 if picked, 0 if neutral, and -1 if rejected.
You could then un-reject a photo with:
If you don't yet have
exiftool on your system, the easiest way to get it is to first install Homebrew, then say
brew install exiftool.
Even with the Automatically Write Changes into XMP setting enabled, there can be an arbitrarily-long delay between a user action in Lightroom and the XMP update hitting the disk, depending on what else Lightroom has going on.
I once lost hours of work by changing a core keyword in my catalog, then hours later running
exiftool on some files to make a change I couldn't make from within Lightroom. After running that command, I said Metadata → Read Metadata from File, then was dismayed to find that those photos' metadata was reset to a state from many hours before because those XMP updates were batched behind the updates for the core keyword change, still running! (It took about a full day for Lightroom to finish updating all the XMP data on disk.)
If I'd said Metadata → Save Metadata to File before running
exiftool on those files, I wouldn't have lost that work, because it jumps the queue, saving the metadata for the selected photos immediately, even if there are prior metadata changes still being saved in the background.