[git] Better fix for IDEA-64583 get message from git log -1 if amending

.git/COMMIT_EDITMSG can't be used for this purpose,
because it is not updated when switching branches.
We need to ask Git about the last message.

Call git log -1 --pretty="%s%n%n%-b" to get the commit message of the
last commit in the original format (subject + two newlines + body,
with newlines skipped if the body is empty).

Join commit messages if user is amending commit in several roots at
once. Maybe that's not what he wants (separate commits with separate
commit messages would be preferably), but let's keep it like that for
now.