How To Undo check-out and discard changes to a file grammatically?
题
If you check out a file from a library on a site, make changes, and then decide you don't want to keep the changes that you made, you can undo the check-out. The changes that you made to the file since you checked it out are discarded, and the file is made available again for other people to edit.
now, want to do same thing bur grammatically...
解决方案
You can use SPFile.UndoCheckOut
to discard the changes.