Check if a node field has changed upon save I am parsing pdf's in a field for a custom content type in a cron job. I have a boolean on each node that determines whether their pdf has already been parsed. I grab the ones I need like so:

$query = \Drupal::entityQuery('node')
    -&gt;condition('status',1)
    -&gt;condition('type', 'issue')
    -&gt;exists('field_pdf')
    -&gt;condition('field_indexed',false)
    -&gt;sort('created','ASC');
if($range &gt; 0){
    $query-&gt;range(0,$range);
}

$issue_nids = $query-&gt;execute();
$issue_nodes = \Drupal::entityTypeManager()-&gt;getStorage('node')-&gt;loadMultiple($issue_nids);

foreach ($issue_nodes as $issue_node){
    //do my pdf parsing magic on field_pdf
    $node-&gt;field_indexed-&gt;value = true;
    $node-&gt;save();
}


This works fine but if the user replaces field_pdf and uploads a new one I want to make field_indexed false again so I know to reindex it. The problem is I don't really have a way of knowing whether the field changed. 

I considered using a presave hook but I didn't see a way to compare the form state to what was currently on the node. 

Is there a way I can detect when a field has changed when a node has saved?
Clive is correct.
$node->original does give access to the original node values. I was able to accomplish what I needed like so

function my_module_node_presave($node) {
    $type = $node-&gt;getType();
    if($type == 'issue'){
            if(isset($node-&gt;field_pdf-&gt;entity) &amp;&amp; !isset($node-&gt;original-&gt;field_pdf-&gt;entity) || empty($node-&gt;original-&gt;field_pdf-&gt;entity) || $node-&gt;field_pdf-&gt;entity-&gt;id() != $node-&gt;original-&gt;field_pdf-&gt;entity-&gt;id()){
                $node-&gt;field_indexed-&gt;value = false;
            } else {
                $node-&gt;field_indexed-&gt;value = true;
            }
    }