Did you forget to create a new branch, and made all your changes in the master/wrong branch?
git switch -c "new-branch"
- Merge FEATURE_BRANCH to MASTER squashing
git checkout master
git merge --no-commit --squash FEATURE_BRANCH
- Solve eventual conflicts.
- Commit merge to master
git commit -m ""
- Remove FEATURE_BRANCH local and remote
git branch -d FEATURE_BRANCH
git push origin --delete FEATURE_BRANCH
- Push to origin
git push
Discard changes in local branch
git reset --hard