You must create a branch first:
git checkout -b fix bcd7c93
git merge -n 8b53674 # merge without auto-commit
Your solution creates:
- a detached head: you wouldn't be able to merge at all, since your next commits wouldn't be referenced by any branch
HEAD
(hence the "detached" part) - a duplicate commit: you wouldn't be able to easily merge back your '
fix
' branch to master (or your current branch from which you found the defective commit)
The idea is to be able to fix the bug (one or two files modified) and merge it back on the main branch without repeating all the other files part of the commit you have found being problematic.