doc <- am_create()
doc$key <- "value"
am_commit(doc, "Add key")
# Get the current heads (change hashes)
heads <- am_get_heads(doc)
head_hash <- heads[[1]]
# Retrieve the change by its hash
change <- am_get_change_by_hash(doc, head_hash)
change
am_change_message(change) # "Add key"
am_close(doc)
Run the code above in your browser using DataLab