You'll want to write a change-content trigger. These triggers are run after files are transferred to the server, but before they are committed to the DB. As per the perforce documentation, you can use a command similar to the following
p4 diff //depot/path/...@=<change>
In the change-content trigger the @= (where change is the changelist number sent to the trigger) will get you the contents of the files that were submitted. If you are looking for a way to check against the server version, you might be able to do something like
p4 diff -sr //...@=<change>
The -sr command will report on files that open and are the same as the current depot contents. Since the files haven't been committed yet, I'm going to assume that you will actually get a list of files whose contents that have been transferred to the server are the same as the current head revision in the depot. If p4 diff -sr returns any files that are the same, return a non-zero exit code and the submit will be halted and the user will have to revert his unchanged files manually.
I don't think that you want to actually modify the contents of the changelist by doing the revert for him. That sounds too dangerous.
Note that you can write your trigger in any language that makes sense (as a previous poster suggested). I do think that this kind of trigger is going to be pretty heavyweight though. You will essentially be enforcing a diff on all contents submitted for all users in order to make one developer step in line. Maybe that's an okay price to pay, but depending on the number of users and the sizes of their changelist (and files), this kind of trigger might take a long time to run.