Git तुम्हाला इतिहास पुन्हा लिहिण्याची परवानगी देते — commits मध्ये सुधारणा, rebasing, squashing किंवा commits काढून टाकण्यासाठी — 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).
