I have two working branches, master and forum and I\'ve just made some modifications in forum branch, that I\'d like to ch
To change the current commit into two commits, you can do something like the following.
Either:
git reset --soft HEAD^
This undoes the last commit but leaves everything staged. You can then unstage certain files:
git reset -- file.file
Optionally restage parts of those files:
git add -p file.file
Make a new first commit:
git commit
The stage and commit the rest of the changes in a second commit:
git commit -a
Or:
Undo and unstage all of the changes from the last commit:
git reset HEAD^
Selectively stage the first round of changes:
git add -p
Commit:
git commit
Commit the rest of the changes:
git commit -a
(In either step, if you undid a commit that added a brand new file and want to add this to the second commit you'll have to manually add it as commit -a only stages changes to already tracked files.)