history()
uses your version control system to show prior versions of the
lockfile and revert()
allows you to restore one of them.
These functions are currently only implemented for projects that use git.
history(project = NULL)
revert(commit = "HEAD", ..., project = NULL)
history()
returns a data.frame
summarizing the commits in which
renv.lock
has been changed. revert()
is usually called for its
side-effect but also invisibly returns the commit
used.
if (FALSE) { # \dontrun{
# 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)
} # }