Το Git σας επιτρέπει να ξαναγράψετε το ιστορικό — να τροποποιήσετε, να κάνετε rebase, να συμπιέσετε ή να αφαιρέσετε 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).
