Is there a way to lock files (checkout)?

Is there a way to lock files? If a open a file, make some changes and save it and another user has opened the sane file in the meantime an has saved changes as well, my changes would be overwritten.

I have to admit that I have not found a way to lock files (I opened the files via the windows desktop client in my local drive). Webdav is not an option as Nextcloud is asking over and over again for credentials which makes me nuts, and I doubt that the native Windows Webdav implementation supports file locking anyway. I also tried a plugin called W2G2 (https://apps.nextcloud.com/apps/w2g2) but that seemed not to work either.