Delete or undo mean it is as if you did not want that commit and when you do a git push in the future, the changes will not push to the remote branch.
If you created the changes and commit to local master repo, and you still want the changes, create a new branch before delete/undo/reset the commit. This way, your new changes will be in the new created branch.
Now go to delete the commit in master repo.
git reset --hard
WILL DELETE YOUR WORKING DIRECTORY CHANGES
If you are sitting on that commit, this command will delete it
git reset --hard HEAD~1
git reset --hard HEAD^
To find out the id of the commit you want to delete
and run this command
git reset --hard <id of the commit>
If you pushed, you should use
For more reference: