A couple of things. First, going forward, make sure that the Auto-Assign Category Parents option (under Admin → Channel Administration → Global Preferences) is set to yes.
Second, to fix all of the pre-existing entries, backup your database, create a new template, enable PHP on it, put this in it, then load the template in your browser. (You'll need to find the Category ID of each of the relevant categories and replace them below.)
<?php
$this->EE =& get_instance();
$child_categories = "1,2,3";
$parent_category = "4";
$entries = $this->EE->db->query("SELECT DISTINCT entry_id FROM exp_category_posts WHERE cat_id IN($child_categories)");
if($entries->num_rows() > 0)
{
foreach($entries->result_array() as $entry)
{
$this->EE->db->query(
$this>EE->db->insert_string(
'exp_category_posts',
array('cat_id' => $parent_category, 'entry_id' => $entry['entry_id'])
)
);
}
}
?>