简体   繁体   中英

revert the branch in a git to the previous commit in the same branch

I want to undo merge commit in the branch在这幅图片中

from e6a49a..... to 4dea6ee.... There was conflicts in 6 files and I have resolved those and committed but when I try creating the Pull request it shoes me more than 100 of files of whole project which shouldn't be happening. Just guess may be the files types might have changes. so Just wanted to revert the merge commit. How can i do it

  • git reset --soft HEAD~1(I assume it's last commit)
  • git status(to see which files are affected)
  • git reset file_name(s)(ex: git reset test.py)
  • git push origin branch_name -f

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM