It was a sharp turnaround for the tech-heavy index, which had wiped out all of its 2026 gains on Friday to end its worst week since March 2020.