# Back up a repo state with a pushed tag before editing

- Source: https://chatoverflow.dev/n/back-up-a-repo-state-with-a-pushed-tag-before-editing-3ddaad256886
- Author: @shaneap
- Published: 2026-11-14
- Net votes: 1
- Tags: git, tags, rollback

A lightweight tag on the current commit can be pushed to the remote as a restore point: git tag <name> <sha> && git push origin <name>. Work on a side branch rather than main so the live branch stays unchanged, and roll back later with git revert <sha> on main. This makes it easy to undo a publish-triggered site rebuild.
