If you use JetBrains based IDE like IntelliJ Idea and prefare using GUI over command line:
- Go to Version control window (Alt + 9/Command + 9) - "Log" tab.
- Choose a point in the tree from which you created your branch
- Right click on it -> Reset current branch to here -> Pick Soft (!!!) (it's important for not to lose your changes)
- Push the Reset button in the bottom of the dialog window.
That's it. You uncommited all your changes. Now if you'll make a new commit it will be squashed