Reset all changes after last commit in git

后端 未结 3 1355
慢半拍i
慢半拍i 2020-12-04 04:45

How can I undo every change made to my directory after the last commit, including deleting added files, resetting modified files, and adding back deleted files?

3条回答
  •  春和景丽
    2020-12-04 05:11

    There are two commands which will work in this situation,

    root>git reset --hard HEAD~1

    root>git push -f

    For more git commands refer this page

提交回复
热议问题