According to The Oxford Companion to the English Language, "were" is
usually used in "if I were you." But in other cases it has been
replaced by "was", bringing it in line with other verbs, where the
simple past tense is used for expressing hypotheses about the past and
future, eg "if I only...