Linux file permissions can reduce accidental changes, but for some files you may also want an extra layer of protection. On filesystems that support it, the immutable attribute can help.
View file attributes
lsattr important.conf
Make a file immutable
sudo chattr +i important.conf
An immutable file cannot be modified, renamed or deleted until the attribute is removed.
Remove the protection
sudo chattr -i important.conf
Use this carefully. It can confuse package updates or configuration management tools if applied to files they need to change.