# Flashback Table - Demo
__*FLASHBACK TABLE*__

+ Statement 1: Check the current timestamp and the number of records in the table.
+ Statement 2: Drop table test.r1 around 14:24.
+ Statement 3: Check GC safepoint.
+ Statement 4: Execute FLASHBACK TABLE operation.
+ Statement 5: Check the restored table.


```
tidb> SELECT COUNT(*), NOW() FROM test.r1;
+----------+---------------------+
| COUNT(*) | NOW()               |
+----------+---------------------+
|        2 | ~!@2022-01-07 14:24:25@!~ |
+----------+---------------------+

tidb> ~!@DROP TABLE@!~ test.r1;

tidb> SELECT * FROM mysql.tidb WHERE variable_name = '~!@tikv_gc_safe_point@!~';
+--------------------+-------------------------+--------------------------------------------------------------+
| VARIABLE_NAME      | VARIABLE_VALUE          | COMMENT                                                      |
+--------------------+-------------------------+--------------------------------------------------------------+
| tikv_gc_safe_point | ~!@20220107-14:11:37 +0000@!~ | All versions after safe point can be accessed. (DO NOT EDIT) |
+--------------------+-------------------------+--------------------------------------------------------------+

tidb> ~!@FLASHBACK TABLE@!~ test.r1 TO r2;

tidb> SELECT COUNT(*) FROM test.r2;
+----------+
| COUNT(*) |
+----------+
|        2 |
+----------+
```
----------------------------------------------------------------------------------------------------------------------------
Statement 3 verifies that GC safepoint is around 14:11, so any data that existed in the last 13 minutes is still kept by MVCC, you can bring it back by FLASHBACK TABLE statement.

Statement 5 shows the data previously in table test.r1 is restored to table test.r2.

