Create a PHP file in your community root with the following contents, then open it in your web browser.
<?php
include 'init.php';
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\downloads\File', 'count' => 0 ), 4, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\downloads\Category', 'count' => 0 ), 5, array( 'class' ) );
echo 'complete';
Then delete the file and the background tasks will then recalculate the file counts.