If you have WP-CLI installed, try to run wp cache flush
or
you can put this code into your functions.php
function fix_template_caching( WP_Screen $current_screen ) {
if ( ! in_array( $current_screen->base, array( 'post', 'edit', 'theme-editor' ), true ) ) {
return;
}
$theme = wp_get_theme();
if ( ! $theme ) {
return;
}
$cache_hash = md5( $theme->get_theme_root() . '/' . $theme->get_stylesheet() );
$label = sanitize_key( 'files_' . $cache_hash . '-' . $theme->get( 'Version' ) );
$transient_key = substr( $label, 0, 29 ) . md5( $label );
delete_transient( $transient_key );
}
add_action( 'current_screen', 'fix_template_caching' );
Reference: Fix for theme template file caching https://gist.github.com/westonruter/6c2ca0e5a4da233bf4bd88a1871dd950
Hope this helps!
:)