Undo a local merge (not comited/pushed yet)
git reset --hard <last-commit-id>
Above command will move to the state of the last commit, ignoring all the changes.
If you want to push after a hard reset, use -f
option
git push origin <branch-name> -f
To checkout by folder
git checkout master -- db/migrate