I did some code changes in Visual Studio from the main branch and tried to commit the changes in a new branch in TortoiseHG, but apparently I accidentally committed the corrections to the main branch. I have not pushed the changes to the remote repository but if I try to do a "Backout" on the change I get the error message "Cannot backout change on a different branch", even though it clearly states that the changes have been committed to the main branch.
Does anyone know why I get this error message and how I can move the changes into the correct branch?
I was able to solve it by making a backup of all files in the commit, adding the extensions "eol" and "mq" in TortoiseHG, right-clicking on the draft branch and selecting "Modify History -> Strip...". Afterwards I simply added the backed up files again and committed them to the correct branch.
Since I'm new to using TortoiseHG I must advise others to be cautious about doing this.