Fetching details from the dictionary...

to differ; to be different
to run counter to
to change (into something out of the ordinary)
「違う」 has another reading with different meanings.
約束にたがう行為だ。
That's an act that breaks a promise.
結果が当初の予想と大きく違った。
The result differed greatly from the initial expectation.
二人の意見は根本から違っている。
The two people's opinions differ fundamentally.