How to revert an over-ridden grade in Moodle

We have a couple of teachers who sometimes accidently mark assignments through the gradebook rather than the assignment, this in turn locks the users grade so that it can't be modified.

To revert this back so the grade can be modified by the teacher you need to do the following a SQL Query
SELECT * FROM mdl_grade_grades WHERE userid='<insert student moodle id number'>

look out for the overridden field and set all entries back to '0' and repeat for all users affected.