Edit after understanding the problem
git rebase is your friend. Just run git rebase -i commit-id
where commit-id
is the one previous to the three you want to remove, then, when the default editor will open, simply delete the three commits you do not want on master, save and close.
Old version, misunderstood
If I understood, you should have no problem with your second request: the commit is still in feature/1234
if you have not deleted the branch.
As for the first request, remove the commit, just run
git reset --hard HEAD~1
which will move the HEAD
back one commit.
If you want to go back to a specific commit by its id, you can run git reset --hard commit-id
.
For more info about reset: http://git-scm.com/blog/2011/07/11/reset.html and https://www.kernel.org/pub/software/scm/git/docs/git-reset.html