Q:

Allow users to revert votes on answers after edit on the question

I just want to get out of the way that this is not meant for a discussion on whether vote lock-in has its place or not.  This question already exists.  
Now, my personal question is,
Should the vote lock-in period be reset if the OP edits his/her question? 

In order to understand my point, consider the following situation (which happened to me),
Someone posted a question with a syntax error which, according to him, was added when posting and not included in his personal code.  At first glance I immediately commented his question underlying the fact that his syntax error was causing the error.  Even though majority of users agreed with me (up-voted my comment), one user wrote an answer proposing something else.  
People, just like me, started to downvote his answer saying it wasn't the real cause of the problem.  After realizing that his syntax was wrongly added when posting, OP edited his question and changed his title to a new and valid question which was correctly answered by the downvoted answer.  
I guess, the author of the answer was thinking out of the box and saw past the syntax error.  Now, his answer will have unnecessary downvotes because the OP changed his question meaning which seems odds to me.  
Note that I would have liked to link the question in order to show the validity of my situation, but the post got deleted.   
Here is the post, which has since been deleted (10K+ link), 
Please also note that I agree this post was awful and probably better suited as duplicate now.  But, as I said in the comments section, this is just another consequence of the OP's edit.  What I really think people should consider from it is the situation not the poor quality of the post.  
I mean if that would have been a good question after the edit, the answer author would have unnecessary down votes which is a flaw in the system. 

A:

I can think of around ten times that I've seen folks get heavily invested and sucked into this sort of scenario since 2011 (where, ultimately, a lot of time was wasted).  A semi-related discussion surrounding this phenomenon in general refers to these as chameleon questions, and talks about ways to exit from them gracefully.  Unlocking downvotes on question edits doesn't really help that phenomenon much unless you notify voters there was a change - most folks just vote and move on unless there's something compelling about the question. 
That didn't quite happen here, even though it's related; something else probably happened.  The OP didn't understand how loops work in Python and introduced a syntax error while anonymizing the code as it was pasted.  I'm fairly certain people knew that, and down-voted because they wanted to discourage folks from answering obvious duplicates - even though that's not why you down-voted.  It's done out of frustration and unfortunately pretty common. 
That's a separate issue that we're going to need to tackle, and we need to tackle that by finding a way to incentivize finding and answering duplicates - this hits on a spot where the software is far from optimal.  I agree, the answer was helpful and didn't deserve down-votes, but it's up to us to correct a different problem in order to fix this one.  
Your insight was good here, but the cause was a little out in left field from what your proposing as the solution, and the solution wouldn't help all that much if it was paired with the problem you set out with, if that makes sense.  
While I'm declining this, it does point out that we have work to do in isle duplicate, it's bad that we've become complicit with 'punishing' correct answers for reasons completely outside of the intended UX (and those mainly are just frustration that we've yet to incentivize finding duplicates in a way that's amiable to new and veteran users alike). 
We're fortunately picking this up as part of our initiative to make the new user experience more welcoming. 