Git revert vs reset: What's the difference?

Git revert vs reset: What's the difference?

Cameron McKenzie

4 года назад

4,049 Просмотров

If you're using git revert to rollback that last commit, you're doing it wrong. Use git reset --hard instead. It's a much more sound approach.

Тэги:

#git #github #reset #revert #last_commit
Ссылки и html тэги не поддерживаются


Комментарии:

Иван Жалдак
Иван Жалдак - 08.11.2023 17:20

what? Only 34 likes? You guys have no soul.

Ответить
Delkor
Delkor - 23.10.2023 12:11

What if you pushed the bad commit to github before doing the reset? Then git pull would throw errors

Ответить
ABD
ABD - 15.01.2022 13:55

Thanks

Ответить
Sixto Oxford
Sixto Oxford - 26.06.2020 21:06

In all my years programming I have never found a good use of git revert.

Ответить