After I press [M-.] to jump to definition, but I can't press [M-,] to jump back.
If you want to jump back you need to call pop-tag-mark which is bound to M-*.
If you want to use M-,, you need to bind it like this
(define-key elpy-mode-map (kbd "M-,") 'pop-tag-mark)
@ChillarAnand thanks
Most helpful comment
If you want to jump back you need to call
pop-tag-markwhich is bound toM-*.If you want to use
M-,, you need to bind it like this