How to discard/undo a check-out on a DriveItem?

Matt Weingartner 25 Reputation points
2023-01-19T07:34:04.0333333+00:00

Hello friends,

I'm using the latest version of the Microsoft.Graph nuget package for .net.

How can I undo a check-out of a DriveItem without creating a new version in the File history?

Currently I check-in the DriveItem, get the Version History and take the previous version and use .RestoreVersion().

The problem here is that this workflow creates 2 new versions in the file history. I was wondering how others resolve this without this unnecessary overhead on versions. 🤔

Is there a better way to do this?


On a sidenote, I came from this link in the ms-graph-docs.


Update:

For anybody who went the same rabbit hole down than I did, I created a feature request idea.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,103 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,516 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,418 questions
{count} votes

Accepted answer
  1. HarmeetSingh7172 4,826 Reputation points
    2023-01-19T16:18:23.8066667+00:00

    Hello @Matt Weingartner

    Thanks for reaching out!

    Restore version graph API restores the already checked in version of a drive Item. However, currently there is no graph API available which can simply discard the checked-out drive Item.
    Since this feature/functionality is presently not available, you can submit a feature request idea using this support link, which will be monitored by Microsoft team and make the enhancements to Microsoft Graph APIs. I will also upvote for you.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.


0 additional answers

Sort by: Newest

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.