Undo a change without making things worse
When something goes wrong, rushing often leads to a move that makes the damage worse. This lesson teaches you to choose the right way to roll back depending on where the change sits, from your own machine all the way to production, without ever rewriting shared history.
Lesson objective
By the end of this lesson, you will be able to choose the right way to undo a change depending on where it is (file, local commit, shared branch, main, production): git restore, git reset, git revert, a pull request's Revert button or a deployment rollback, without ever forcing shared history.
Topics covered
- undo a commit
- git revert
- git reset
- deployment rollback
- force push
In the glossary
Where it fits
Safety nets and rollback
What stops a mistake from reaching users, and what do I do if it gets through anyway?
Lessons in this module
- The safety nets that protect production
- Undo a change without making things worse (this lesson)
What you will learn in this module
This lesson is part of the course Git for PMs: ship as a team without putting production at risk
- Assess a repository's safety nets (branch protection, required checks, mandatory review, feature flags, staging, progressive rollout) and propose the missing ones.
- Choose the right way to undo a change (restore, revert, reset, deployment rollback) depending on whether it is local, pushed, merged or already in production.
Related courses
- Tech for PMsAll levelsNo prerequisites: accessible to everyone.
Explain how a web product works, from browser to server
2 hr 30 min
- Tech for PMsJuniorSome basics are useful: introductory knowledge of the topic.
Design and test an API integration as a PM
3 hr
- Tech for PMsJuniorSome basics are useful: introductory knowledge of the topic.
Model your product’s data and query it with SQL
3 hr 30 min