upvoting the answer from user355252 and adding to it :
(require 'package) (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t) (package-install 'magit)