Git আপনাকে ইতিহাস পুনর্লিখন করার অনুমতি দেয় — commits সংশোধন, rebase, squash, বা সরানো — commits পরিষ্কার করতে বা সমস্যা সমাধান করতে। এটি শক্তিশালী কিন্তু সাবধানে করতে হবে: shared ইতিহাস পুনর্লিখন গুরুতর সমস্যা সৃষ্টি করে, তাই এর চারপাশের নিয়মগুলি সমালোচনামূলক।
ইতিহাস পুনর্লিখনের উপায়
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).
