Revert the lockfile to its contents at a prior commit.
revert(commit = "HEAD", ..., project = NULL)
The commit associated with a prior version of the lockfile.
Optional arguments; currently unused.
The project directory. If NULL
, then the active project will
be used. If no project is currently active, then the current working
directory is used instead.
The commit used when reverting renv.lock
. Note that this function
is normally called for its side effects.
The revert()
function is currently only implemented for projects using
git
for version control.
# NOT RUN {
# }
# NOT RUN {
# get history of previous versions of renv.lock in VCS
db <- renv::history()
# choose an older commit
commit <- db$commit[5]
# revert to that version of the lockfile
renv::revert(commit = commit)
# }
Run the code above in your browser using DataLab