I am working on a topic branch which I will call 'topic'. A colleague pushed some changes to a shared branch called develop which I wanted to pull into the topic branch. I figured I'd want to rebase as pushing a merge commit seemed messy. So I performed the following commands:
git checkout develop
git pull
git rebase topic develop
git checkout topic
git merge develop
The git pull I performed pulled down several changes including the one I wanted. I have my git configured to always rebase when pulling down in case that is relevant.
It was only after I performed all the commands I realised I've changed the shared history and messed up. I haven't pushed anything yet. What is the best way to undo/fix the above? Will this fix things in a safe way in my situation, despite the fact that my situation involves changing shared history?