git diff --name-only <mainDev>
Since Git 2.23 (August 2019) you can use restore:
git restore pathTo/MyFile
The above will restore MyFile on HEAD (the last commit) on the current branch.
If you want to get the changes from other commit you can go backwards on the commit history. The below command will get MyFile two commits previous to the last one. You need now the -s (--source) option since now you use master~2 and not master (the default) as you restore source:
git restore -s master~2 pathTo/MyFile
You can also get the file from other branch!
git restore -s my-feature-branch pathTo/MyFile