c.1200, mi, reduced form of mine used before words beginning in consonants except h- (my father, but mine enemy), and from 14c. before all nouns. As interjection, by 1825, probably a shortened form of my God!
12c. shortening of Old English ic, first person singular nominative pronoun, from Proto-Germanic *ekan (cf. Old Frisian ik, Old Norse ek, Norwegian eg, Danish jeg, Old High German ih, German ich, Gothic ik), from PIE *eg-, nominative form of the first person singular pronoun (cf. Sanskrit aham, Hittite uk, Latin ego (source of French Je), Greek ego, Russian ja, Lithuanian aš). Reduced to i by mid-12c. in northern England, it began to be capitalized mid-13c. to mark it as a distinct word and avoid misreading in handwritten manuscripts.
The reason for writing I is ... the orthographic habit in the middle ages of using a 'long i' (that is, j or I) whenever the letter was isolated or formed the last letter of a group; the numeral 'one' was written j or I (and three iij, etc.), just as much as the pronoun. [Otto Jespersen, "Growth and Structure of the English Language," p.233]
The form ich or ik, especially before vowels, lingered in northern England until c.1400 and survived in southern dialects until 18c. The dot on the "small" letter -i- began to appear in 11c. Latin manuscripts, to distinguish the letter from the stroke of another letter (such as -m- or -n-). Originally a diacritic, it was reduced to a dot with the introduction of Roman type fonts.