You assign the item a Forecast item group and switch its ‘Full demand history rebuild required’ flag on.  When you next run Generate demand history, it will be generated for all past periods for the item regardless of the number of periods selected for the run itself.