Your question is unclear. So I am assuming you need your old version of master, and you need your new version of Dev. This means you will need to change your git history. If you have pushed these commits to your remote, this is not what you should be doing, as you don't want to be messing with git history.
What you do is cherry-pick
the commits from master, and then reset your master to before the commits.
Before you do that, you should backup your data:
git checkout master
git checkout -b backup_master
git checkout DEV
git checkout -b backup_DEV
How to cherry pick:
How to cherry-pick multiple commits