From Urdu مگر (magar), from Classical Persian مگر (magar).
mágar (conjunction, Perso-Arabic spelling مگر)