The home page is locked. A folder of contracts shows the little green arrow with a name that no longer works here. Someone asks whether checking it in will "delete all the files created since". It will not. But the other button will delete something, and they are next to each other.
Check in vs. discard: what each keeps
- Check in takes the checked-out user's working version and makes it the new current version. Their edits are kept. Nothing created by anyone else is touched — files are independent objects; checking one in cannot affect another.
- Discard check-out throws away the working version and reverts the file to the last checked-in version. Their unsaved edits are gone. Again, no other file is affected.
So the answer to "will it delete the documents created since 2021?" is no, either way. The only thing at risk is the edit the departed user was making to that file, and only if you choose discard.
For a page in Site Pages the same applies: check in publishes their draft as the page; discard reverts to the last published version.
Who can do it
The site owner (Full Control) can check in or discard anyone's check-out. Technically it is the Override Check Out permission, which Full Control includes and Edit does not. A library-level Contribute user cannot fix this; that is why it lands with admins.
One file
File → ⋯ → More → Check in (or Discard check out). If the option is missing, you are not an owner on that library.
The hidden list of stuck files
There is a second, worse kind of stuck file: uploaded but never checked in, which happens when a library requires check-out and someone drags in a batch and leaves. Those files are invisible to everyone but the uploader.
Library settings → Permissions and Management → Manage files which have no checked in version (/_layouts/15/ManageCheckedOutFiles.aspx?List=<id>). Tick them → Take ownership of selection, then check them in from the library.
All of one person's files, across the library
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/Legal -Interactive
$lib = 'Contracts'
$stuck = Get-PnPListItem -List $lib -PageSize 2000 -Fields FileRef,CheckoutUser |
Where-Object { $_['CheckoutUser'] } |
Select-Object @{n='Path';e={$_['FileRef']}}, @{n='CheckedOutTo';e={$_['CheckoutUser'].Email}}
$stuck | Group-Object CheckedOutTo | Select-Object Count, Name # who, and how many
$stuck | Where-Object CheckedOutTo -eq 'a.former@contoso.com' | ForEach-Object {
Set-PnPFileCheckedIn -Url $_.Path -CheckinType MajorCheckIn -Comment 'Checked in by admin - user left'
"checked in $($_.Path)"
}
Use Set-PnPFileCheckedIn to keep their work. To discard instead, PnP has no dedicated cmdlet; the CSOM call is $file.UndoCheckOut() on Get-PnPFile -AsFileObject. Decide per person, not per file: a departed editor's half-finished drafts are usually worth keeping as a version.
Finding the departed users automatically
The join that makes this a five-minute job instead of a spreadsheet exercise is checked-out-to against account disabled in Entra — so you are not asking HR for the leavers list, or guessing from names. That join, plus showing the list before anything is checked in, is the part we built the tool for. Unlock365 does that join inside the library: scan for checkouts, filter to accounts that are disabled in Entra, and check in (or, guarded, discard) in bulk. It writes only the check-in call and shows the list before it runs.