TGI Fridays will remain on UK high streets after a rescue deal was secured for the restaurant chain - but more than 1,000 staff have lost their jobs.