“Twisting” and “preserving history” are roughly the exact opposite in terminology.
If you mean that you want to make one commit that includes only your changes, and not those that are in the master, you probably want to rebase to the source / master, and then format it. You can do all this from a single interactive redirect call:
git fetch origin git rebase -i origin/master
and then change all the lines after the first from pick to squash .
source share