Git Reset Hard

preview_player
Показать описание
Want to reset the last commit to undo changes you don't want hanging around?

You could use a git revert, but git reset will remove the Git commit from your branch history. This rolls you and the files in your workspace back to the previous commit, while making the commit you reset over orphaned.

In this git reset hard tutorial we use the hard switch and the commit id to of the Git commit to reset to.

By the way, use the git reset hard, not soft or mixed, to make sure the index is cleared and the files in the workspace is restored.
Рекомендации по теме