Git చరిత్రను తిరిగి వ్రాయడానికి అనుమతిస్తుంది — commits లను సవరించడం, rebasing చేయడం, squashing చేయడం, లేదా తీసివేయడం — commits లను శుభ్రపరచడానికి లేదా సమస్యలను పరిష్కరించడానికి. ఇది శక్తిశాలిగా ఉంది కానీ జాగ్రత్తగా చేయాలి: సాధారణ చరిత్రను తిరిగి వ్రాయడం గంభీర సమస్యలను కలిగిస్తుంది, కాబట్టి దాని చుట్టూ ఉన్న నియమాలు కీలకమైనవి.
చరిత్రను తిరిగి వ్రాయడానికి మార్గాలు
git commit --amend → modify the most recent commit (message or content)
git rebase -i → squash, reword, reorder, edit, drop commits (interactive)
git rebase <branch> → replay commits onto another base (linear history)
git reset → move the branch pointer (discard/uncommit)
git filter-repo → rewrite MANY commits (remove a file/secret from all history)
→ All of these change commit HASHES (rewriting = creating new, different commits).
