General Motors and the Unifor union reached an agreement hours after more than 4,000 workers went on strike on Tuesday.