You could revert the commit bb5678
with -n
(no commit) option, then restore all other files except code/main.js
, and then do a commit:
git revert -n bb5678
git status
take note of any changed files, then checkout all the files listed by git status, except the one you want to revert
git checkout foo bar
git commit
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…