We use git with different branches. A colleague made a mistake and committed (+ pushed) a few different commits to the wrong branch (dev branch).
The branch he committed to should be merged into 'master' anyway. I wonder if these steps would be safe:
- Merge changes from dev branch into master
- Push all changes to origin/master
- In dev branch - revert so all commits are dropped
- Push (force) to make sure the remote repository is in sync (e.g: drops all wrong commits)
Will these pose any issues in the repository later on ? (e.g: with the merge commit and the fact that the original commits were removed) ?